refactor: the expression parser is package-private, and the parsed tree is named apart from the program's - #342
Merged
Conversation
Documentation build overview
25 files changed ·
|
FBumann
force-pushed
the
refactor/private-expression-parser
branch
from
September 1, 2026 16:34
9542897 to
bb4cf0a
Compare
FBumann
force-pushed
the
refactor/private-expression-parser
branch
from
September 1, 2026 16:49
bb4cf0a to
c8b55ae
Compare
FBumann
force-pushed
the
refactor/private-expression-parser
branch
from
September 1, 2026 17:05
c8b55ae to
b5a5413
Compare
FBumann
changed the base branch from
main
to
feat/where-parse-failure-names-rewrite
September 1, 2026 17:05
Base automatically changed from
feat/where-parse-failure-names-rewrite
to
main
September 1, 2026 17:11
…ee is named apart from the program's Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9qaMS43V6yaNApJPmuWtM
FBumann
force-pushed
the
refactor/private-expression-parser
branch
from
September 1, 2026 17:11
b5a5413 to
3b7bcbf
Compare
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.
expression_parser.pybecomes_expression_parser.py— package-private and off the generated API docs (the docs hooks skip_*.py), the end state #323 gave the where grammar. The public surface is now exactlySpec+Program, with everything between private;__init__'s "reachable by module path for a renderer" sentence dies with the exposure it described. The parsed union is renamedParsedNode, soExpressionNodemeans one thing in the package: the lowered vocabulary a consumer reads. Closes #337.Breaking (described here per the refused-marker rule): importers of
math_spec.expression_parserbreak on the module path. There is no known external importer — no lpspec repo exists, docs never referenced the module — so the break is theoretical.Two sentences swept with the decision:
__init__'s "stays path-reachable deliberately" paragraph (written in #327, before #337 decided otherwise), and the module docstring's claim that the AST "can be evaluated against a namespace of linopy variables and xarray parameters" — an engine claim #315 retired from the program side.Stack: on #346, at the maintainer's direction — the small independent diff goes to
mainfirst, the rename rides on it.Verified
pixi run ciexit 0 in this worktree on #346's head (itself onorigin/mainpost-#345): lint clean, 1011 passed,mkdocs build --strictbuilds (the module's API page drops out via the hooks'[!_]*.pyglob — a dangling nav entry would fail the strict build), 27 TeX documents compile; working tree clean after the run.git grep math_spec.expression_parserfinds nothing;ParsedNodelives in_expression_parserwith four internal importers (degree,dimensions,expansion,resolution).No behaviour change — every test passes untouched except import paths; the 13 lint fixes in the diff are ruff's import re-sorts for the underscored name.
Deliberately not done: renaming
ArithmeticNode(no collision), and any grammar/AST split within the private module — privacy removes the reason the where side needed one.