Skip to content

feat!: specsolve requires mathspec 0.4.0, where a file names a reusable condition under conditions: rather than masks: - #2062

Draft
FBumann wants to merge 2 commits into
mainfrom
feat/mathspec-main
Draft

FBumann wants to merge 2 commits into
mainfrom
feat/mathspec-main

Conversation

@FBumann

@FBumann FBumann commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Prompt: Please update specsolve to mathspec main.

Note

The following content was generated by AI.

specsolve builds the files of mathspec main at 0f892c0, which will be released as 0.4.0. missing: neutral stays, because main still has it. Every PyPSA rung matches again. The PR waits for mathspec 0.4.0 on PyPI.

What changed
  • Imports and classes. mathspec renamed its program classes (energy-models/mathspec#855): ParameterDeclaration is Parameter, and the old Parameter is ParameterReference. Variable and NamedExpression swap the same way. The renames ran as one simultaneous mapping, so no name was renamed twice. Conditions replace predicates (energy-models/mathspec#904): for example, Predicate is Condition and NamedMask is ConditionReference, and the fields Assumption.holds, CountComparison.condition and GivenTargets.conditions follow. mathspec.validation is mathspec._validation (energy-models/mathspec#878).
  • Files. A file names a reusable condition under conditions: and writes it under condition: (energy-models/mathspec#907). differential/pypsa/projection.py reads both keys.
  • Hand-built nodes. Each expression node now needs its dims= (energy-models/mathspec#899). Only tests build nodes by hand, so only tests changed. src/ builds none.
  • PyPSA corpus. The corpus moves to mathspec main. A corpus from 0.3.0 does not load under 0.4.0, because it writes masks:. prep.standing supplies each component's *_active_asset flag, which energy-models/mathspec#886 adds: PyPSA's static active, read from the first scenario. pypsa-parity.yml checks out v0.4.0.
  • Pins. mathspec>=0.4.0,<0.5, and the floors environment pins ==0.4.0.
  • Regenerated. The rungs, tables and references.json; the ladder, gallery and construct pages; and the walkthrough golden file. docs/development/architecture.md names the renamed nodes.
Verification

pixi run check cannot solve until mathspec 0.4.0 is on PyPI. So the gates ran in the default pixi environment with pixi run --as-is, with mathspec main at 0f892c0 built as a wheel stamped 0.4.0. On 117c1f8; b15fafc adds only the changelog line:

  • lint, format-check: pass.
  • typecheck: 0 errors on both configurations.
  • test: 5759 passed, 574 skipped, 4 xfailed. tests/test_changelog.py passes again on b15fafc.
  • differential/pypsa/parity.py against mathspec main's corpus, run the way pypsa-parity.yml runs it: every rung matches, exit 0.

Not run: test-via-pyarrow, test-bench, docs-build, docs-test, and the floors environment.

Coverage that moved
  • test_a_named_mask_builds_the_model_its_where_builds is now test_a_named_condition_builds_the_model_its_condition_builds, and it writes conditions:.
  • known_failing.yaml drops rung_63_modular_branches_and_storage, which matches on this corpus (energy-models/mathspec#883).
  • untested.txt: 27 lines change only because the node text changed, for example NamedMask( to ConditionReference( and the added dims=. 16 lines are new gaps from chore(main): release 0.0.1-alpha.164 #886. On every rung, the *_active_asset conjunct is never false for Line, Transformer, StorageUnit and Store.
Not done

🤖 Generated with Claude Code

https://claude.ai/code/session_01EsnGSGGQso2HHaNdgWeAt6

…le condition under `conditions:` rather than `masks:`

Port to mathspec main (0f892c0): the program classes take their
construct's name (#855), mathspec's private modules start with an
underscore (#878), a condition is a condition rather than a predicate
(#904, #907), and every expression node states its dims (#899).

The PyPSA rungs, tables, ladder, gallery and construct pages and the
walkthrough golden file are regenerated against mathspec main's corpus.
prep supplies each component's `*_active_asset` flag, which #886 adds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsnGSGGQso2HHaNdgWeAt6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsnGSGGQso2HHaNdgWeAt6
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants