Skip to content

feat(language): an open bound is null and an infinite bound is refused, the way mathspec 0.0.0-alpha.127 does - #1744

Merged
FBumann merged 2 commits into
mainfrom
claude/elegant-albattani-nxcxiz
Sep 25, 2026
Merged

FBumann merged 2 commits into
mainfrom
claude/elegant-albattani-nxcxiz

Conversation

@FBumann

@FBumann FBumann commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Prompt: update specsolve to the latest mathspec release. It also renamed everything to "mathspec", not "math-spec"

Note

The following content was generated by AI.

The pin moves from math-spec v0.0.0-alpha.122 to mathspec v0.0.0-alpha.127. Every import, URL and mention says mathspec. A variable bound's open side is now null. Both engines read it as ±∞. An infinite bound is refused.

Breaking: a spec that writes upper: .inf (or lower: -.inf) no longer loads. Write null or leave the side out. mathspec's refusal gives this rewrite.

What changed, gates, and what was not run

Rename (energy-models/mathspec#702):

  • math_spec becomes mathspec and math-spec becomes mathspec in src/, tests/, docs/, examples/, differential/, bench/, .github/, mkdocs.yml and pyproject.toml. This includes the pypsa-parity checkout of energy-models/mathspec and its grep for the pin.
  • Kept unchanged: math-spec.readthedocs.io, because mathspec kept that Read the Docs slug. All 48 distinct docs URLs still resolve against mathspec's docs/ at the tag. CHANGELOG.md, because it holds released entries (mathspec did the same). bench/reproduce.py.lock, because it freezes an old environment at math-spec alpha.85.
  • uv.lock comes from uv lock --upgrade-package mathspec.

Open bounds (energy-models/mathspec#689, released in alpha.124):

  • VariableDeclaration.lower/upper are None on an open side. Before, they held Constant(±inf).
    • relational/engines/polars/compiler.py: bounds reads None as lit(∓inf).
    • linopy/builder.py: _bound reads None as ∓inf. _check_bounds_are_defined skips an open side.
  • Tests: two fixtures dropped upper: .inf. test_json_carries_a_model_too now asserts bounds.lower is None. test_infinite_bounds_survive_the_handoff builds its open side as upper=None and no longer as Constant(inf), which mathspec no longer produces. It now fails when the polars engine reads an open upper side as 1e9.
  • Not simplified, on purpose: the sinks keep their infinity handling. A bound parameter's data can still hold inf. A null lb/ub already means a bound parameter has no value there. So the open side becomes ±∞ where each engine reads the bound, and nothing downstream changes.

Other upstream changes that reached tests:

Gates. pixi's installer is blocked here (403), so these ran in a uv venv with Python 3.12, the linopy,gurobi,xpress extras and the dev group:

  • ruff check .: clean. ruff format --check .: 327 files already formatted.
  • pyrefly check, both configurations: 0 errors.
  • pytest -q -n 8: 4033 passed, 319 skipped, 1 xfailed. origin/main on alpha.122 gives the same counts.
  • pytest bench/test_harness.py: 149 passed, 6 skipped. It ran with --i-know-another-is-running, because the load average was still falling after the suite and nothing else was running. These tests check objectives, not timings.
  • zensical build --strict: no issues. pytest tests/test_docs_math.py: 69 passed.

Not run: test-floors, and the PyPSA parity gate (differential/pypsa/parity.py). This diff changes only a docstring in the parity script. The parity gate still reads the new corpus.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XdbYXKrogqppf3cPD932Dh

…d, the way mathspec 0.0.0-alpha.127 does

The pin moves from math-spec v0.0.0-alpha.122 to mathspec
v0.0.0-alpha.127. The dependency now installs and imports as mathspec,
so every import, URL and prose mention follows. The Read the Docs links
keep the math-spec slug, which the site still uses. CHANGELOG.md and
bench/reproduce.py.lock keep the old name, because they record releases
and a frozen environment.

mathspec 0.0.0-alpha.124 holds an open side of a variable bound as None
rather than as an infinite constant, and refuses an infinite bound. Both
engines now read None as the matching infinity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdbYXKrogqppf3cPD932Dh
@read-the-docs-community

read-the-docs-community Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

@read-the-docs-community

read-the-docs-community Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 82 skipped benchmarks1


Comparing claude/elegant-albattani-nxcxiz (da43e02) with main (8c783ca)2

Open in CodSpeed

Footnotes

  1. 82 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (6fd6513) during the generation of this report, so 8c783ca was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

…es, with no upper bound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdbYXKrogqppf3cPD932Dh
@FBumann
FBumann merged commit 1b1dbef into main Sep 25, 2026
14 checks passed
@FBumann
FBumann deleted the claude/elegant-albattani-nxcxiz branch September 25, 2026 09:20
fluxopt-release-bot Bot added a commit that referenced this pull request Sep 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.0.1-alpha.357](v0.0.1-alpha.356...v0.0.1-alpha.357)
(2026-09-25)


### Features

* **language:** an open bound is null and an infinite bound is refused,
the way mathspec 0.0.0-alpha.127 does
([#1744](#1744))
([1b1dbef](1b1dbef))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: fluxopt-release-bot[bot] <307443024+fluxopt-release-bot[bot]@users.noreply.github.com>
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