Repository navigation
fix(language): an at that joins on a dimension it also consumes is refused, as a sum already was - #1696
Closed
FBumann wants to merge 1 commit into
Closed
fix(language): an at that joins on a dimension it also consumes is refused, as a sum already was#1696FBumann wants to merge 1 commit into
FBumann wants to merge 1 commit into
Conversation
…fused, as a sum already was math-spec moves from 0.0.0-alpha.105 to c25984e, the head of energy-models/mathspec#566. The pin is a commit rather than a tag because that PR is open and stacked on two more; it is not a pin to merge on. The refusal is the outcome a model author sees. at()'s joined-column check asked whether a joined dimension was produced, which the landing check already refuses, rather than whether it was consumed, so `at(load, by=diag, over=rep, into=generator)` loaded and landed with the joined dimension gone. sum already refused the same shape. Carrying it is a port of the relation node API, which no consumer can tell apart. Walk is now Direction, with Partition split off as its own class rather than a direction with nothing consumed or produced, and the accessors that inverted between the two operators are gone: a node's ends are read off its direction, and an At reads the direction the other way round at the four sites that care. GroupSum.walk and At.walk are .direction; .over, .into, .joined and .relation are .direction.consumed_dims, .produced_dims, .joined_dims and .name, each read in the operator's own terms. Coverage moved: test_by_takes_a_relation asserts position(by=)'s new refusals — a parameter and an undeclared name now take the message every operator's by= gives, and a dimension is told by= takes the map out of it — and test_a_call_walks_one_table_and_says_so follows "walks one table" to "reads one table". The thirteen generated pages are tools.gallery_math and tools.ladder re-run; the diff is one legend line per page, "the order shift walks" becoming "the order shift steps along". Not done here: math-spec#566 also adds ExpressionComparisonNode and ArithmeticComparisonNode, which neither lane evaluates. Four tests are red on that and land with the evaluator in the PR stacked on this one, as #566's own body says they should. pytest -q -n auto: 4016 passed, 251 skipped, 1 xfailed, 4 failed — the four above. ruff check and ruff format clean. pyrefly reports 2 errors, both assert_never on those same two nodes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NHXujoUG77G2SoDbhau5mS
Documentation build overview
13 files changed ·
|
Merging this PR will not alter performance
Comparing Footnotes
|
FBumann
added this pull request to stack #1698
September 19, 2026 19:05
FBumann
marked this pull request as draft
September 19, 2026 19:06
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.
math-spec moves from
0.0.0-alpha.105toc25984e, the head of energy-models/mathspec#566.at()'s joined-column check asked whether a joined dimension was produced, which the landing check already refuses, rather than whether it was consumed — soat(load, by=diag, over=rep, into=generator)loaded and landed with the joined dimension gone.sumalready refused that shape.The pin is a commit, not a tag, because math-spec#566 is open and stacked on two more unmerged PRs. This is an integration branch rather than a pin to merge on: it wants a tag once that stack lands.
Carrying the refusal is a port of the relation node API, which no consumer can tell apart.
The API that moved
Walkis nowDirection, andPartitionis split off as its own class rather than a direction with nothing consumed or produced. The accessors that inverted between the two operators are gone, so a node's ends are read off its direction and anAtreads the direction the other way round at the four sites that care.program.Walkprogram.DirectionGroupSum.walk,At.walk.directionGroupSum.over,.into.direction.consumed_dims,.produced_dimsAt.over,.into.direction.produced_dims,.consumed_dims.joined,.relation.direction.joined_dims,.nameWalk(rel, consumed, produced, joined)Partition(rel, along, group, joined).consumed,.produced,.consumed_dims.along,.group,.along_dim67 call sites across seven modules in both lanes:
relational/engines/polars/{compiler,relations,reindex}.pyandlinopy/{builder,loader,where}.py.Coverage moved
test_by_takes_a_relationassertsposition(by=)'s new refusals. A parameter and an undeclared name now take the message every operator'sby=gives; a dimension is told thatby=takes the map out of it.test_a_call_walks_one_table_and_says_sofollows"walks one table"to"reads one table".GEN_BUS_WALKisGEN_BUS_DIRECTION.The thirteen generated pages are
tools.gallery_mathandtools.ladderre-run. The diff is one legend line per page — "the ordershiftwalks" becoming "the ordershiftsteps along".Gates
Run through
uvrather than pixi, which is not installed in this environment — a departure from thepixi run checkdefault.uv sync --group dev --extra linopy --extra gurobi --extra xpressmatches what pixi'sdefaultenvironment installs. Re-run after the rebase ontomain.pytest -q -n autoruff check .ruff format --check .pyrefly checkThe four failures and both type errors are one thing, and it is not this PR's: math-spec#566 also adds
ExpressionComparisonNodeandArithmeticComparisonNode, which neither lane evaluates yet. They go green in the PR stacked on this one, which is where math-spec#566's own body says that evaluator belongs.Not run:
test-bench, the sweep, and the docs build. The typst gallery cases skip for want of the binary, as they do in CI.Deliberately not done: the mask expression evaluator, which is the stacked PR. No mutation table — this PR adds no correctness guard, it moves call sites onto a renamed API.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NHXujoUG77G2SoDbhau5mS
Generated by Claude Code