feat(language): a boundary clause names a position, not the label at one - #1230
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Documentation build overview
48 files changed ·
|
Merging this PR will not alter performance
Comparing Footnotes
|
Co-Authored-By: Claude <noreply@anthropic.com>
…notation Co-Authored-By: Claude <noreply@anthropic.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.
First of two. Adopts energy-models/math-spec#31 —
index(dim, i)is retired forposition(dim), which converts on the left.#31 is merged and released, so the pin is an ordinary tag again —
v0.0.0-alpha.9— and the commit-pin rationale this PR carried while #31 was in flight is gone frompyproject.toml. That also removes the blocker this PR was drafted behind, so it is out of draft.Both lanes already compared positions, so the language change is a surface migration and not a semantics change.
snapshot > index(snapshot, 0)was ambiguous in the language — a coordinate comparison or a position comparison, and the two part company on an axis whose coordinates do not arrive sorted — but this engine only ever built the position reading:_position_ordinalnormalises to an ordinal and compares againstarange, relationally and eagerly alike.What changed
v0.0.0-alpha.4tov0.0.0-alpha.9. That is five releases, not one feature: it carries A bound cannot be an expression, so a bidirectional flow ships a negated copy of its capacity as data #31, plus #34 (to_markdownprinted TeX's---ligature rather than an em dash), #41 (the notation page is generated again) and #44, below.where:in the corpus — 5 port models, 6 doc pages, the tests — rewritesdim OP index(dim, i)toposition(dim) OP iand the grouped form toposition(dim, by=lookup) OP i.where: position(snapshot) == 3 names position 3 of 'snapshot', which has 3 coordinate(s).tests/test_index_of_dim.py→tests/test_position_of_dim.py.The gallery moved twice, and most of the diff is that
Both refreshes are generated output —
tools.gallery_math, nothing hand-edited.#31's own page work. Six pages gained a legend for the operator they print, a negative position prints against the set's size rather than as a bare
-1, and a dimension whose labels are numbers says so:#44 — upright is what the model is given, italic is what the solver chooses. This touched 40 pages and is the larger half of the diff:
Four lpspec tests asserted the old spelling for parameters and were updated with it —
test_power.py(LaTeX and typst:italic("growth")→upright("growth")) andtest_sum_back.py's window condition. Variables were left alone, which is the point: the same assertions still read\mathit{started},\mathit{on}.Coverage that moved
test_two_different_dimensions_cannot_be_compared_by_positionis gone, because what it asserted is gone: A bound cannot be an expression, so a bidirectional flow ships a negated copy of its capacity as data #31 drops resolution's same-dimension check, sinceposition(dim)yields an integer and there is no pair of coordinates left to compare across label spaces. Replaced bytest_a_position_along_a_dimension_the_frame_lacks_is_refused, which pins the rule that now speaks instead — the ordinary dim-algebra one.test_the_retired_index_spelling_names_its_rewrite: every seeding clause in this tree usedindex()until today, so the migration message is what stands between a stale model andExpected end of text, found '('.Verified
Full suite on Python 3.12, HiGHS: 2965 passed, 323 skipped, 1 xfailed.
ruff check,ruff format --checkandpyrefly checkoversrc/clean.Not checked: the
gurobiandxpresssinks — neither wheel is installed here, so their 10 tests fail identically before and after and are the entire delta from a green run. The typst golden tests skip for want of the binary. Nothing was measured; this PR makes no performance claim.Deliberately not done
No example was added for the construct; it is a rename of one already in the corpus.
cases:is the PR above this one, and still blocked on math-spec#36.