Skip to content

feat: rename LinopyYamlError to LpspecError - #394

Merged
FBumann merged 1 commit into
mainfrom
fix/lpspec-error
Jul 31, 2026
Merged

feat: rename LinopyYamlError to LpspecError#394
FBumann merged 1 commit into
mainfrom
fix/lpspec-error

Conversation

@FBumann

@FBumann FBumann commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Closes #389. Supersedes #390, which GitHub auto-closed when its base branch (docs/trim, now merged as #388) was deleted — same commit, same content, retargeted to main.

The problem

lps.solve goes YAML → polars → HiGHS and imports nothing from linopy. lpspec.linopy is not in __all__. The bare-install CI job runs the entire suite with linopy, xarray and pandas absent.

And yet the root of the public exception tree was LinopyYamlError — so on that path, the only place a user met the word "linopy" in normal use was the traceback of every error they hit, including errors about a parquet file.

The change

LpspecError(ValueError)
├── LanguageError  (SchemaError, DimensionError, PiecewiseExpansionError)
├── DataError
└── NoSolutionError

A pure rename: 32 insertions, 32 deletions, no alias, no shim.

No deprecation path, deliberately

An earlier draft kept LinopyYamlError working through a module __getattr__ with a DeprecationWarning. That is gone, because the repo's own release tooling makes the argument against it: the conventional-commit gate refuses ! and BREAKING CHANGE: while the version is pinned to the alpha stream, on the grounds that "the alpha stream carries no compatibility promise, so there is nothing for the version to announce."

A deprecation shim is machinery in service of a guarantee we have not made. Removing it also keeps the declared surface exactly __all__, with nothing clever behind it.

Migration

# before
except lps.LinopyYamlError:

# after
except lps.LpspecError:

ValueError still catches everything, as before — LpspecError subclasses it.


709 passed, ruff check clean, ruff format --check clean, pyrefly 0 errors, mkdocs build --strict clean.

Not marked ! for the reason above.

🤖 Generated with Claude Code

The old name dated from when this package was called linopy-yaml. It had become
the sharpest place a dependency the product path does not have leaked into the
surface: `lps.solve` goes YAML -> polars -> HiGHS and imports nothing from
linopy, `lpspec.linopy` is not in `__all__`, and the bare-install CI job proves
the whole suite runs without it — so on that path the only place a user met the
word "linopy" in normal use was the traceback of every error they hit.

Removed outright rather than aliased. The alpha stream carries no compatibility
promise — the release tooling says so itself, refusing `!` and `BREAKING CHANGE:`
on the grounds that there is nothing for the version to announce — so a
deprecation shim would have been machinery in service of a guarantee we have not
made. Migration is `except lps.LinopyYamlError` -> `except lps.LpspecError`, and
`ValueError` catches everything either way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@FBumann, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4eb5e509-c24c-416e-9fc4-0bfef5e462eb

📥 Commits

Reviewing files that changed from the base of the PR and between bdfe8b4 and 2a785ab.

📒 Files selected for processing (12)
  • docs/ARCHITECTURE.md
  • docs/api.md
  • docs/design/linopy.md
  • src/lpspec/__init__.py
  • src/lpspec/errors.py
  • src/lpspec/relational/executor.py
  • src/lpspec/relational/result.py
  • src/lpspec/relational/sinks/highs.py
  • tests/test_api.py
  • tests/test_architecture.py
  • tests/test_duals.py
  • tests/test_typeset.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@FBumann
FBumann merged commit 5f72731 into main Jul 31, 2026
4 checks passed
@FBumann
FBumann deleted the fix/lpspec-error branch July 31, 2026 10:46
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.

LinopyYamlError names a dependency the product path does not have

1 participant