Skip to content

feat(language): a variable, a constraint and a cased expression declare their shape as dims, as a parameter does - #1634

Merged
FBumann merged 1 commit into
mainfrom
claude/sleepy-pascal-i7719a
Sep 15, 2026
Merged

FBumann merged 1 commit into
mainfrom
claude/sleepy-pascal-i7719a

Conversation

@FBumann

@FBumann FBumann commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Prompt: Lets update lpspec to the latest mathspec release

Note

The following content was generated by AI.

Follows math-spec to v0.0.0-alpha.88. A variable, a constraint and a cased
expression now declare their shape as dims:, the key a parameter already
used; foreach: is gone from the language, so every model file in the tree is
rewritten.

alpha.87 is the only release in the range that changes what a file may say
(energy-models/mathspec#429). alpha.86 adds the lookups to the names a
mistyped where is answered with, and alpha.88 is documentation. The lowered
Program this package consumes was already spelled dims, so no engine logic
moved — the rename reaches the model files, the docstrings that quote the key,
and the prose.

  • pyproject.toml and uv.lock to alpha.88.
  • foreach: → dims: across examples/, differential/pypsa/rungs/,
    bench/models/, and the inline specs under tests/.
  • Engine internals that said "the foreach dims" now say "the frame dims", and
    refuse_outside_foreach is refuse_outside_frame: the word was the retired
    key's, and what it describes is the declaration's frame.
  • docs/, README.md and both notebooks follow. No page needed regenerating —
    the three generators agree with the renamed models.

No alias and no hand-written message for foreach:; the closed schema's own
error names the valid keys. No test asserted the old spelling as behaviour, so
no coverage moved.

What was verified, and what was not

Run on this branch's head, against math-spec 5656b11 (v0.0.0-alpha.88):

pytest -q -n auto            3960 passed, 251 skipped, 1 xfailed
ruff check .                 All checks passed!
ruff format --check .        318 files already formatted
pyrefly check                0 errors (package, and the linopy reference scripts)
pytest bench/test_harness.py 140 passed, 5 skipped   (idle box, load < 3 on 4 cores)
mkdocs build --strict        clean
python -m tools.gallery_math --check   47 pages match their models
python -m tools.ladder --check         clean
python -m tools.constructs --check     docs/examples/index.md matches the models

Not run: the depth-3 expression sweep, and the CodSpeed job.

bench/ carries only model files here, so the harness run is a check that the
renamed models still load and solve — it takes no numbers and this PR publishes
none.

The one collision the sweep created

_wide_objective_of in tests/test_arithmetic_laws.py took a foreach
argument and built a local named dims for the dimensions mapping, so renaming
the argument made the second shadow the first and the constraint declared a
mapping where a list belongs:

math_spec.errors.SchemaError: constraints.c.dims: Input should be a valid list

The local is now dimensions. It was the only such clash in 205 files, and the
suite caught it.

Incidental lockfile churn

uv lock also tightened six environment markers it had been carrying loose —
pycparser, linkify-it-py, ptyprocess and memray's three. Tool output
rather than an edit of mine, and left as the tool wrote it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C8VMbam9FtNjVAzmUYabQV


Generated by Claude Code

…re their shape as dims, as a parameter does

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C8VMbam9FtNjVAzmUYabQV
@codspeed

codspeed Bot commented Sep 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 58 skipped benchmarks1


Comparing claude/sleepy-pascal-i7719a (587143c) with main (6dd80ce)2

Open in CodSpeed

Footnotes

  1. 58 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 (77966df) during the generation of this report, so 6dd80ce was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@FBumann
FBumann enabled auto-merge (squash) September 15, 2026 09:06
@FBumann
FBumann merged commit 7bdcdeb into main Sep 15, 2026
12 checks passed
@FBumann
FBumann deleted the claude/sleepy-pascal-i7719a branch September 15, 2026 09:08
fluxopt-release-bot Bot added a commit that referenced this pull request Sep 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.0.1-alpha.331](v0.0.1-alpha.330...v0.0.1-alpha.331)
(2026-09-15)


### Features

* **language:** a variable, a constraint and a cased expression declare
their shape as dims, as a parameter does
([#1634](#1634))
([7bdcdeb](7bdcdeb))

---
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