Conversation
… into=, as an expression does The where grammar read one name or arithmetic after a kwarg's `=`, so `at(p, by=r, over=a, into=[b, c])` failed to parse in a where string while the expression grammar took the list. The bracketed name list is now one grammar element both parsers use. Closes #781. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
… as a link walks one `activity:` takes a mapping with variable, by, over and into, and the weights sum to the binary read through the relation, as `at` reads it. A curve whose coordinate has no row in the relation is ungated; under `absence: zero` only a missing row ungates it. The walk is held to the rules of `at`, and a gate landing outside `dims:` is refused. The walk keys and their check move onto a base both the link and the gate take. The program carries the gate as a `Gate`: its variable, the read, and where a curve reads it, which the expansion, the typesetter and the reserved names all read. Reference page section: 8 sentences, median 16 words, none over 25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Documentation build overview
16 files changed ·
|
FBumann
added this pull request to stack #785
September 29, 2026 09:29
Takes #788 through #630. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
This branch has not been deployed
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 #630.
activity:may read its binary through a relation, so a unit-commitment status over its own dimension gates the curves it maps to. fluxopt no longer needs a re-indexed copy ofrunning, or the constraint that ties the copy to it.What this changes
The expansion writes two convexity rows:
absence: zeropins a curve off where the relation has a row. The rows then readwhere: pw_status_ofandNOT pw_status_of.at. The gate lands on dims ofdims:, and a gate landing elsewhere is refused on the block's line. A bare name stays a gate ondims:, as before.running_{pw_status_of(c),t}where it exists, and 1 otherwise.Why
This is the first ask from the fluxopt port, accepted on #630 as a follow-up.
running[status_entity, time, period]is the one binary that startup costs and up/down times are written against. The curve is perconverter, and #630 admits only a gate overdims:.Where it lives, and what it reuses
spec._Walkby,over,into,walksand the together-or-not-at-all check, moved offPiecewiseLink.PiecewiseLinkand the newPiecewiseActivityboth take itspec.PiecewiseActivityvariable:and a walk. It serialises back to the form written, as a link does. The schema admits both formsprogram.Gatevariable, the typedread, andexists, where a curve reads the gate. It replacesPiecewiseDeclaration.activity: strpiecewise.gate_textpiecewise.resolve_gateat, so the walk meets the same refusals an expression doespiecewise._gate_fitsdims:validation._piecewise_referencesdims:only, and its message now names the walk as a rewrite_gateprintsgate.readundergate.exists. The reserved names readgate.exists, notleaves_ungatedof a variableA gate on
dims:prints and expands as before: the golden output and every generated page regenerate with no diff.Tests, gates, and what was not run
Seven cases in
tests/test_piecewise.py, on fluxopt's unit-commitment shape (COMMITTED):absence: zeroreads the relation alone;otherwisearm;period, whichdims:lacks; a walk missingoverandinto; aby:that names no relation.Each guard has a test that fails without it:
_gate_fits, the gate landing onperiodloads, and the test fails withDID NOT RAISE LanguageError._piecewise_references, the use case is refused:activity 'running' carries ['status_entity'], which dims ['converter', 'snapshot'] does not.pytest -q -n autoruff check,ruff format --check(0.16.1)pyrefly check(1.2.0)prettier --checkon the reference page,typospython -m mathspec checkloads itdocs-build,compile-texdocs.python.org, and there is no tectonicThese ran in a uv venv (Python 3.12) with the pinned tool versions, since pixi cannot be installed here.
Deliberately not done
🤖 Generated with Claude Code
https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Generated by Claude Code