Conversation
…scount factor is written where it is used `x / (a + b)` and `(1 + rate) ** years` load. The degree check refused a sum anywhere under a divisor, a base or an exponent. The program already carries the tree, and the typesetter prints it in all three formats. The PyPSA stochastic example reads `alpha` and divides by `1 - alpha` in CVaR-def, instead of binding the inverted tail as data. expressions.md: n 92, avg 15.4, median 14, over25 11 (was n 91, same). Closes #277 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C8aNCHBtTstYhudLqHhafW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GpnFcQDuvt2bExGngb6MYk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8Y8AoPsJCyMsURHvgzm7h
brynpickering
approved these changes
Sep 27, 2026
FBumann
pushed a commit
that referenced
this pull request
Sep 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7TEPiMeF7aowcvTX6CRRh
Contributor
Author
|
Superseeded by #757 |
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
x / (a + b)and(1 + rate) ** yearsload. Arithmetic over numbers and parameters is allowed under a divisor, a base and an exponent. A variable there is still refused. Closes #277.Why
Before this change, the degree check refused a sum anywhere under
/or**, so a discount factor had to ship as a prepared column. The program already carries these trees, and the typesetter already prints them.Method, gate output, what moved, what was not done
The change.
src/math_spec/degree.pyloses_addsand its two refusals. Nothing else insrc/read a divisor's shape:lowering,dimensions,boundednessand the typesetter walk already take any variable-free subtree.Where the refusal coverage moved. The four
test_degree.pyrefusal cases (a-sum-as-a-base,a-sum-as-an-exponent,a-divisor-that-adds,an-addition-under-a-reduction-divisor) are now cases oftest_an_affine_expression_passes_everywhere. Thewhererefusala-divisor-that-addsintest_validation.pyis now a case oftest_a_where_comparing_expressions_loads, beside a newa-base-that-adds. A new typesetting test,test_a_base_that_adds_is_bracketed_and_a_divisor_that_adds_is_not, runs in every format. On the olddegree.py, 9 of these fail. With the change, they pass.Typeset, all three formats:
\left( 1 + \mathrm{cost}_{g} \right)^{2}and\frac{p_{t,g}}{\mathrm{cost}_{g} + \mathrm{p}^{\mathrm{max}}_{g}}(1 + ...)^(2)andfrac(p_(t,g), ... + ...)Docs.
expressions.mdreplaces the single-factor paragraph with a whole model that divides by(1 + rate) ** years. The model was loaded withpython -m math_spec check, and it is refused onmain.1 / (1 - alpha)as data. It now bindsCVaR_alphaand writes1 / (1 - CVaR_alpha)inCVaR-def. The gallery page is regenerated withpython -m tools.gallery. The typeset row islimits.mdhad no row for this refusal, so it does not change.Gates.
pixi run lint: pass.pixi run test: 1607 passed.pixi run docs-build: fails in this container because the proxy blockshttps://docs.python.org/3/objects.inv. The samemkdocs build --strictpasses with that one inventory removed from a temporary copy ofmkdocs.yml.pixi run compile-tex: not run. Tectonic cannot fetch its bundle fromrelay.fullyjustified.net, so all 31 documents fail, changed or not. CI runs it.Deliberately not done.
(1 + rate) ** periodover the dimensionperiodis refused, andperiod's coordinates ship as a parameter.absence.mdkeeps "a divisor" among the positions where a missing parameter row has no value that contributes nothing. It now covers every parameter in a divisor, including the parameters of a sum.examples/pypsa.yamlbinds PyPSA's(1 - standing_loss) ** elapsed hoursas data prep, which could now be derived.examples/pypsa_linearized_uc.yaml:116says two parameters cannot be compared in awhere, which the arithmetic comparison already made false.🤖 Generated with Claude Code
https://claude.ai/code/session_01C8aNCHBtTstYhudLqHhafW
Generated by Claude Code