Repository navigation
Conversation
…s own term to the ledger program.yaml is split into ten fragments under math/program/, which `program()` composes with mathspec's `merge`. effects.yaml declares `effect_temporal` and `effect_lump` as sums with a frame and no body (energy-models/mathspec#742); flows, status, sizing, investment and storage each add one named term to them. A fragment reads what another declares under `given:`, and each loads and prints on its own. The merged spec declares the same 93 parameters, 18 variables and 86 constraints as the monolith, with identical text. The only new names are the five per-feature terms, which a result now reports as well. PROGRAM is now the fragment directory. tests/math/test_fragments.py holds the fragments to that shape, and shows a fee added in a file of its own reaching the objective with no shipped file edited. test_data's ledger check follows the terms one level down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVhM31okkc7zrhYj7DncVs
6 of 9 tasks
Documentation build overview
47 files changed ·
|
FBumann
added this pull request to stack #292
September 27, 2026 17:03
Contributor
Benchmark hint
test_reference_build
Replicate locally / compare against chore/specsolve-mathspec-0.2uvx --from 'pytest-benchmem[plot]' benchmem sweep fluxopt \
git+https://github.com/fluxopt/fluxopt@chore/specsolve-mathspec-0.2 \
git+https://github.com/fluxopt/fluxopt@claude/fluxopt-mathspec-732-yesoe9 \
--suite benchmark/ --memory
uvx --from 'pytest-benchmem[plot]' benchmem compare .benchmarks/sweep/*.jsonOne fresh venv per ref, checkout untouched; covers the archetype, IO and reference-system benchmarks. Alternative flows: benchmark/README.md. |
FBumann
marked this pull request as ready for review
September 29, 2026 07:00
8 of 9 tasks
FBumann
added a commit
that referenced
this pull request
Sep 29, 2026
_(Intent: to be written by the author.)_ > [!NOTE] > The following content was generated by AI. ## Description The stack #274 → #357 in one PR, so it lands with one merge and one CI run instead of 62. Each commit below was already reviewed in its own PR. This PR adds only the merges that bring the stack up to date with `main`, plus one doc fix. **Included PRs, bottom to top:** #274, #275, #289, #290, #291, #293, #294, #295, #296, #297, #298, #299, #300, #301, #302, #303, #304, #305, #306, #307, #308, #310, #311, #312, #313, #314, #315, #316, #317, #318, #319, #320, #321, #322, #323, #324, #325, #326, #327, #328, #329, #330, #331, #332, #333, #336, #341, #342, #343, #344, #345, #346, #347, #348, #349, #350, #351, #352, #353, #354, #355, #357. **How `main` was brought in:** main was merged into #274 and then carried up the stack one branch at a time. The branch that first ran into each conflict got the fix: - `pyproject.toml` (#290, #341): kept the stack's dependency block and applied main's `linopy==0.9.0` pin. #354 later drops `linopy` and `netcdf4`, and that wins. - `README.md` (#319, #351): kept the stack's text and restyled the code blocks the way ruff 0.16 formats them (main's lint bump). - `benchmark/uv.lock` (#341): regenerated with `uv lock`. - ruff 0.16 also reformats four notebooks (#351). The same formatting is in 19ab587. - #213 is already reverted on `main` (#356). `main`'s tree equals the revert commit inside the stack (ef32b05), so the merge with `main` takes the stack's tree unchanged. - #357 on top: the ruff `T201` ignores keep main's `benchmark/flixopt_stress.py` and swap `src/fluxopt/benchmark.py` for `benchmark/reference.py`. The two `python -m fluxopt.benchmark stress` commands that main's #271 added (`benchmark/flixopt_stress.py`, `docs/benchmark.md`) now point at `reference.py`. These merge commits were never pushed to the stack branches, so those PRs still show conflicts on GitHub. Once this merges, they can be closed. ## Type of Change - [ ] Bug fix - [x] New feature - [x] Documentation update - [x] Code refactoring ## Related Issues Supersedes #274 … #357 (the list above). ## Testing - [x] I have tested my changes - [x] Existing tests still pass <details><summary>Gates</summary> On this branch: ```text pytest tests -n auto 695 passed, 72 skipped benchmark/ pytest --benchmark-disable 31 passed ruff check / format clean pyrefly check 0 errors ``` At the branches where a conflict was resolved (before #357): ```text #290 chore/pin-lpspec 700 passed, 83 skipped lint ok #341 chore/specsolve-mathspec-0.2 704 passed, 74 skipped lint ok #351 refac/specsolve-api 710 passed, 72 skipped lint ok #354 refac/drop-dead-weight 704 passed, 72 skipped lint ok #355 refac/timestamps-only 703 passed, 72 skipped lint ok ``` #274 and #319 could not be tested: their pinned git dependencies no longer resolve (`farkas` is now published as `specsolve`). That affects only those intermediate states, not this branch. The docs build and notebooks were left to CI. </details> ## Checklist - [x] My code follows the project style - [x] I have updated documentation if needed - [x] I have added tests for new functionality (if applicable) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0182CG6AhGfcNcWshCsR8Rt5 --- _Generated by [Claude Code](https://claude.ai/code/session_0182CG6AhGfcNcWshCsR8Rt5)_ --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Note The following content was generated by AI. Landed in #358 (squash-merged into Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Intent: to be written by the author.)
Note
The following content was generated by AI.
Description
program.yamlbecomes ten fragments undermath/program/, one per feature, composed by mathspec'smerge.effects.yamldeclares the ledger's two halves as empty sums (energy-models/mathspec#742), and each feature adds its own term. The composed math is the same.effects.yamleffect_total, the limits, the objective, andeffect_temporal/effect_lumpas sums with no bodyflows.yamlrate, the carrier balance, flow hoursflow_hour_costs→ temporalstatus.yamlstatus_costs→ temporalsizing.yamlsize,size_builtsizing_costs→ lumpinvestment.yamlinvestment_costs→ lumpstorage.yamlstorage_costs→ lumpconverters.yaml,piecewise.yaml,ramps.yaml,status_sizing.yamlWhat gets better. The ledger no longer lists every feature. A feature brings its term, and a caller brings a new one in a file of its own, with no shipped file edited (see the new test). Each term is one expression that sums the feature's contributions, so a result reports each feature's share of every effect by name. Each file loads and typesets alone. The cross-feature rules (status × sizing, ramps) are files you can see.
What it costs. 896 → 1076 lines. The 11 dimensions are declared 44 times. There are 57
given:entries, mostly shared flags and envelopes;status.yamlalone reads 11. The flag coupling (has_sizingread by status,has_investby sizing) is now visible, but it is not gone.Type of Change
Related Issues
Stacked on #341.
Testing
Equivalence, gates, what was not done
Equivalence. The merged spec against the ported monolith of #341, declaration by declaration, with descriptions ignored:
Changes.
PROGRAMis the fragment directory, andprogram()merges it. Package data shipsmath/program/*.yaml.test_data's ledger check follows the terms one level down. The newtests/math/test_fragments.pychecks three things: every fragment loads alone, the merge leaves nothing given, and a grid fee in a fragment of its own triples a unit-cost bill.Gates (Python 3.12, pandas 3.0.6 with pyarrow, and pandas 2):
Not done.
docs/design/*.mdstill describeprogram.yaml.What mathspec could take from this. Reading shared dimensions and parameters without restating them would remove most of the added lines.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01UVhM31okkc7zrhYj7DncVs