build(deps): a quantity that changes by regime is stated once, so ten of the ladder's recorded differences from PyPSA are gone - #1466
Merged
Conversation
… of the ladder's recorded differences from PyPSA are gone math-spec v0.0.0-alpha.51 -> v0.0.0-alpha.52, whose PyPSA file states each of the split constraints once through `cases:`. The rung projection keeps a cased quantity whole, there being no sound way to cut inside one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TZbCoSM1Ah7YWg6K4Ps5sU
Merging this PR will not alter performance
Comparing Footnotes
|
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.
Note
The following content was generated by AI.
Stacked on #1464, which teaches both engines
cases:. This is the corpus arriving:math-spec
v0.0.0-alpha.51→v0.0.0-alpha.52, where the PyPSA file states each splitconstraint once.
Ten recorded differences from PyPSA are gone — every one of the regime splits, which
were the only class with a route to closing. All 15 rungs still MATCH, and five of them
now carry no structural difference at all.
What the remaining 22 are
None is a language gap, and none can be closed by stating the file differently.
negated:entries (fix(differential): a dual the file writes negated is held to the negative of PyPSA's rather than excused #1444) assertours + theirs == 0at max_abs_diff0.0. They are proofs living in the same file.==,<=,>=where PyPSA writes one rowper labelled constraint whatever its sense.
cases:is value-level and cannot reach anoperator; that is
math-spec#239, closed
not planned.objective_constantfixed variable (3), the capacity floor and cap copied once perscenario over one variable (5), a binary bounded at 1 and capped by a row (4), and one
degenerate dual.
The rung projection keeps a cased quantity whole
projection.pycuts each rung's file to what that rung builds. It cannot cut inside acased quantity: doing so decides from the names a region reads whether that region
applies, which only the region's mask is entitled to say — and a mask reads the other way
as often as not,
not committablebeing true exactly wherecommittableis absent. Afirst cut that dropped a region on that basis lost a term worth 75 on rung 3 and was
caught by the projection gate, which holds each cut to the full file's objective.
Kept whole, a cased quantity states what the file states, and the declarations it names
are kept whether or not the rung fills them — as the file itself does. The visible
consequence is that three tables (
Generator_status_initial,Generator_ramp_limit_start_up,Generator_ramp_limit_shut_down) are now first declaredon rung 3 rather than rung 7, the ramp allowance's
boundaryregion naming them thereeven though its mask is empty.
Verified
PyPSA parity's own runner against the corpus atv0.0.0-alpha.52: all 15 rungsMATCH, exit 0, and the committed certificate, projections and tables are what a re-run
produces. The gate that reports a reason no rung needs is what named the ten stale
entries, so their removal is measured rather than asserted.
pixi run lint/format-checkclean;pyrefly0 errors, both legs.pixi run test— 3461 passed, 254 skipped, 94 failed, every failurexpress(theexpired local licence, matched by file and parameter id). The three extra skips against
feat(language): a quantity defined by cases may mix a constant, a parameter and a variable across its regions #1464 are
test_merge_markerson the three tables that moved rung.tools.ladder --checkclean; the index and all 15 rung pages regenerated.pixi run test-bench— nobench/file changed.Deliberately not done
not plannedupstream.would have to reason about masks, which is what made the first attempt wrong.