feat(language): a where may read a predicate through a relation with at() - #1718
Merged
Merged
Conversation
…at() math-spec 0.0.0-alpha.119 carries `at(<predicate>, by=, over=, into=)` in a where as `PulledBackPredicate`. Both lanes read it as they read an expression's `at`: the relational lane walks the admitted coarse coordinates through the relation, the linopy lane reads the evaluated mask through `operator_at`. A fine coordinate the relation has no row for is false. The pin moves from alpha.116, with `uv.lock` relocked. Upstream dropped `PiecewiseExpansionError` (a piecewise block now raises `DimensionError`), so `lps.PiecewiseExpansionError` goes too, and `ArithmeticComparison`, which no lowered program carried, so the two lanes' dead branches go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzN7uYEvHW9dDGCmtAzbkD
…ed-parameter probe reads it bare Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzN7uYEvHW9dDGCmtAzbkD
Merging this PR will not alter performance
Comparing Footnotes
|
fluxopt-release-bot Bot
added a commit
that referenced
this pull request
Sep 23, 2026
🤖 I have created a release *beep* *boop* --- ## [0.0.1-alpha.350](v0.0.1-alpha.349...v0.0.1-alpha.350) (2026-09-23) ### Features * **language:** a where may read a predicate through a relation with at() ([#1718](#1718)) ([cfaa01b](cfaa01b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: fluxopt-release-bot[bot] <307443024+fluxopt-release-bot[bot]@users.noreply.github.com>
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.
The pin moves from math-spec alpha.116 to alpha.119. Both lanes now build the new
at(<predicate>, by=, over=, into=)in awhere:(energy-models/mathspec#634), and they agree on the result. A coordinate with no relation row reads false. 70 insertions, 34 deletions.What moved
PulledBackPredicate: the relational lane walks the coordinates the operand admits throughwalk_join, as an expression'satdoes. The linopy lane reads the evaluated mask throughoperator_at. Before this change, both lanes hitassert_never.PiecewiseExpansionErroris gone upstream (refactor(language): an expression resolves straight into the program's own nodes energy-models/mathspec#638). A piecewise block now raisesDimensionError, solps.PiecewiseExpansionErrorgoes too, with no alias.test_api,test_architectureandtest_piecewisefollow, and so doesdocs/reference/api.md.ArithmeticComparisonis gone upstream (refactor(program): a comparison of expressions is one node before and after lowering energy-models/mathspec#631). The two lanes' branches for it were never reached, so they go.NEVER_LOWEREDintest_resolution_paritygoes with them.test_a_where_reads_a_relationgains 2 cases andtest_a_relation_where_agrees_with_the_oraclegains 3: a total relation, a partial one, a negation and a conjunction.COVERED_ELSEWHEREnames the oracle test forPulledBackPredicate. Before the implementation, the coverage guard failed on it.sum()over a scalar, so the carried-parameter probe intest_strategyreadssoc_initialbare. It still asserts the refusal names "carried".uv.lockis relocked. Only the math-spec entry changed.Mutation table
Run by hand on the committed tree. Each file was restored through
git checkout --and__pycache__was dropped. The runs covertest_label_coords.pyandtest_resolution_parity.py.fillna(True))fill_null(True))masked(..., None))Gate
The run used
uvwith the[linopy]extra, not pixi. The xfail is the knownosemosys_utopia/ #894 case. Of the 11 failures, one was thetest_strategyprobe, which is fixed in the second commit. The other 10 are the gurobi and xpress parametrizations oftest_diagnosticsandTestThePositionalHandoff. They raiseModuleNotFoundErrorbecause neither package is installed here, and they fail the same way onorigin/main.Not run:
docs-build,docs-test,test-floors,test-bench, the gurobi and xpress sinks. I did not regenerate the gallery pages. The typesetter changed upstream (energy-models/mathspec#629), but the doc tests passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01LzN7uYEvHW9dDGCmtAzbkD
Generated by Claude Code