fix(typeset): a substituted term that opens with a minus prints as a subtraction - #759
Merged
Merged
Conversation
…subtraction Substituting a plain named expression whose body opens with a minus printed `a + -b`, and one whose body is a sum printed `a + -b + c`. The walk now substitutes the body before it folds the sign, and re-associates a sum on the right of a plus to the left, so both print as the file written out does: `a - b` and `a - b + c`. The golden model carries the case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2
FBumann
enabled auto-merge (squash)
September 28, 2026 15:50
FBumann
disabled auto-merge
September 28, 2026 15:53
FBumann
pushed a commit
that referenced
this pull request
Sep 28, 2026
Brings #742, #743, #756 and #759. Only CHANGELOG.md conflicted, and it keeps both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2
FBumann
pushed a commit
that referenced
this pull request
Sep 28, 2026
#740 gives each of the nine sums one owning fragment, names the terms in `pypsa.yaml`, simplifies the splitter and adds a page per fragment. The language, typesetter and their tests keep main's side, which holds #742 and #759 as merged. The PyPSA files take #740's side, the splitter writes `empty: true` on each owner block, and the fragments and pages are regenerated from `pypsa.yaml`, which keeps #717's per-snapshot coefficients. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2
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.
What this changes
A substituted term that opens with a minus prints as a subtraction:
a - banda - b + c, nota + -b. The fix is split out of #740.Guards, gates
The test fails on
mainand passes here. Mutation table, taken by hand with agit checkout --restore and a clean tree after:The golden model gains
netandnetted, so the line census reaches both new lines. The golden output and the notation page are regenerated.Gates: I could not install pixi here, so I ran the gates in a Python 3.12 venv.
pytestpasses (2117), andruff,pyrefly,typosandprettierare clean.zensical build --strictgives only the docs.python.org inventory warning, whichmainalso gives here. Not run:compile-tex,reuse lint,zizmor,taplo.Why
The file written out prints
a - b. The substituted file printed the same term differently.🤖 Generated with Claude Code
https://claude.ai/code/session_01CQxVP5uX2V4rpvJNPhbyR2