Conversation
Documentation build overview
19 files changed ·
|
Merging this PR will not alter performance
Comparing Footnotes
|
…hey run along math-spec#569 renames the axis key on `piecewise:` and `sos:` from `over:` to `along:`, and lpspec follows it: every model, example, fixture and documented model takes the new key, and `curves.py`, `assembly.py` and the linopy builder read `along` off the declarations. The language already separated `over=`, which consumes a dimension, from `along=`, which keeps it and keeps it ordered. A breakpoint axis is ordered and survives into the weights, so it was on the wrong side; `sos:` moves with it because `method: sos2` hands one block's axis straight to the other's. `Buildable` widens to `Mapping[str, object]`, which is what `to_spec` now takes, so `test_the_model_argument_is_what_the_language_takes_minus_the_lowered_form` holds again. Two test expectations follow upstream wording rather than behaviour: the sos dim refusal now says `along 'other' is not a dim`, and a stray values dim is judged against its own link's row frame rather than against every link expression. The pin is PROVISIONAL — a math-spec branch, because #569 is unreleased. Repin to the first tag carrying it before merge. Ran `pytest` (3778 passed, 10 failed, 337 skipped, 1 xfailed — the 10 are the gurobi and xpress extras, not installed here, each failing with the package's own message saying so), `ruff check`, `ruff format --check` and `pyrefly check`. pyrefly is 6 errors: the base branch with this same pin installed reports 15, the extra nine being the `.over` reads this commit renames, and the 6 that remain are the identical set the base reports on its own pin. Did not run `pixi run check` as a whole, the differential harness or the benchmarks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hh3uK8SqVcXKuLnYHAjrVW
FBumann
force-pushed
the
claude/mathspec-piecewise-api-7j0wpt
branch
from
September 19, 2026 19:31
3ae9da5 to
1acda30
Compare
FBumann
changed the base branch from
main
to
claude/happy-maxwell-9ldgqa-where-expressions
September 19, 2026 19:31
…e-expressions' into claude/mathspec-piecewise-api-7j0wpt
FBumann
added this pull request to stack #1698
September 19, 2026 20:01
Collaborator
Author
|
Note The following content was generated by AI. Closing as superseded and stale.
If math-spec releases the piecewise rename, the follow-up is a fresh PR from main: bump the pin, and rename the key in the piecewise examples, their 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.
Note
The following content was generated by AI.
What this changes
energy-models/math-spec#569 renames the axis key on
piecewise:andsos:fromover:toalong:. lpspec follows it: every model, example, fixture and documented model takes the new key, andcurves.py,assembly.pyand the linopy builder readalongoff the declarations. 3779 passing, 10 failing — the 10 are thegurobiandxpressextras, which are not installed here.Draft, and it cannot merge yet. The pin points at a math-spec branch, because #569 is unreleased. Repin to the first tag carrying it before merge.
Rebuilt on #1697. This branch previously carried its own
Walk→Directionrelation migration and its own refusal of awhere:comparing two expressions. #1696 did the first and #1697 the second, both better, so both were dropped rather than rebased — the stack is the base branch, and what is left is the #569 delta alone.What was dropped, and why
Walk→Direction, gavePartitionits own type and spelled the parametersdirectionthroughout. This branch had renamed the type while leaving the parameterswalk, and had not separatedPartition. Replaying it would have reverted fix(language): an at that joins on a dimension it also consumes is refused, as a sum already was #1696's naming.ExpressionComparisonNode. feat(language): a where may compare arithmetic over parameters on both lanes #1697 builds it on both lanes — a side compiles the way a constant side of a constraint does. Refusing what the stack below builds is a contradiction, so the refusal, its message inerrors.py, itslanes.loweredcheck and its tests all went.test_both_lanes_refuse_the_same_where'sp_max > costcase belongs to feat(language): a where may compare arithmetic over parameters on both lanes #1697'sACCEPTEDnow.What is left
PiecewiseDeclaration,SosDeclaration,Increasing,Curved,AtLeastTwoover→alongover:→along:underpiecewise:andsos:BuildableMapping[str, object], which is whatto_specnow takesTwo test expectations follow upstream wording rather than behaviour: the sos dim refusal now says
along 'other' is not a dim, and a stray values dim is judged against its own link's row frame rather than against every link expression.Why the key moved. The language already separated
over=, which consumes a dimension, fromalong=, which keeps it and keeps it ordered. A breakpoint axis is ordered and survives into the weights, so it was on the wrong side; the expansion already wroteshift(seg, along=bp)for that same dimension.sos:moves with it, becausemethod: sos2hands one block's axis straight to the other's.Why the diff is this small. #569 is large, but the surface it exposes to an engine is not: its whole
program.pydiff is 14 insertions and 10 deletions — the five renames above, and one new field,PiecewiseDeclaration.where.dims:, the link refinement, the per-link signs and the pin rule are all expansion and load-time validation inside math-spec, so a refined link reaches this package as anat(...)it already builds. Checked rather than assumed: math-spec's ownexamples/piecewise_coupling.yaml— a two-flow boiler and a three-flow CHP tied on one curve throughconverter_of— builds on both lanes with nothing here beyond this PR, and solvesoptimalon the relational lane.Gates, and what could not be run
Gates ran from a
uvenvironment on Python 3.13 with math-spec installed from the #569 branch at057c56f, because this environment's egress proxy refusespixi.sh— a departure from thepixi run checkdefault. Every number below is measured on395b996e, the current head.pytest, with[linopy]andpyarrowruff check,ruff format --checkpyrefly checkpixi run checkas a wholedifferential/,bench/, the docs buildgurobiandxpressextrasThe pyrefly number needs its comparison: the base branch with this same pin installed reports 15, the extra nine being exactly the
.overreads this branch renames. The 6 that remain are the identical set the base reports on its own pin (api.py×2,frames.py×3, one unused-ignore inassembly.py), and pyrefly here is 1.3.1, newer than the pin.docs/examples/*.mdtook theover:→along:rename in their hand-maintained model blocks. The generated math is untouched, #569 having changed no operator wording.What this leaves
PiecewiseDeclaration.whereis not consumed, so the feature does not work here yet. A block may now say which members have a curve at all.validate_curve_extentdoes not read that mask — its docstring states the premise that has become false, that "the λ it declares carries no mask" — socheck()passes and the build then demands data for a curve the model said does not exist:It is not a patch to that function:
validate_curve_extentis called fromtidy_sources, the lane-agnostic data door, where noScopeexists, and a second mask walk incurves.pyis what hard rule 3 exists to prevent. Its own issue, and a blocker for anyone usingwhere:on a block.Nothing was measured, so no performance number is claimed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hh3uK8SqVcXKuLnYHAjrVW