-
Notifications
You must be signed in to change notification settings - Fork 0
LinopyYamlError names a dependency the product path does not have #389
Copy link
Copy link
Closed
Labels
area:apiNative entry points and CLINative entry points and CLIbreakingChanges the YAML surface; land before there are usersChanges the YAML surface; land before there are usersdecisionA question to be answered, not work to be done; closes by resolutionA question to be answered, not work to be done; closes by resolutionroadmapDecided yes: on the plan. Applied on resolution, replacing 'decision'Decided yes: on the plan. Applied on resolution, replacing 'decision'
Description
Metadata
Metadata
Assignees
Labels
area:apiNative entry points and CLINative entry points and CLIbreakingChanges the YAML surface; land before there are usersChanges the YAML surface; land before there are usersdecisionA question to be answered, not work to be done; closes by resolutionA question to be answered, not work to be done; closes by resolutionroadmapDecided yes: on the plan. Applied on resolution, replacing 'decision'Decided yes: on the plan. Applied on resolution, replacing 'decision'
The public exception tree is rooted at
LinopyYamlError:That name is left over from when this package was called
linopy-yaml. It is now the sharpest place linopy leaks into a surface that does not use linopy:lps.solve/build/write/checkgo YAML → polars → HiGHS and import nothing from linopy. The bare-install CI job proves it.lpspec.linopyis not in__all__— the shim is a submodule you opt into.A user who never installs the
[linopy]extra still catchesLinopyYamlError. That is confusing on its own, and actively misleading when the error is about a parquet file.Why now
The
breakinglabel reads "Changes the YAML surface; land before there are users." The same reasoning applies harder here — an exception class is caught by name in user code, so a rename gets more expensive with every install.docs/design/linopy.mdcurrently has to carry a paragraph explaining the name, which is the tell.Options
A — rename to
LpspecError. Matches the package. KeepLinopyYamlError = LpspecErroras a deprecated alias for a release or two, sinceexcept LinopyYamlErrorin user code should not break silently.B — rename to
ModelError. Reads better in a traceback and does not bind the tree to the package name. Risk: generic enough to collide conceptually withLanguageError, and "model" is overloaded (alinopy.Modelis a different thing).C — leave it. Costs nothing today and the docs explain it. Gets worse monotonically.
I lean A: the tree is already named after the package one level down (
LanguageError,DataErrorare generic), so the root is the one place the package name belongs.Scope
DeprecationWarning__all__,errors.py, and the exception-tree line indocs/api.mdandARCHITECTURE's Python-surface tabletests/test_architecture.pypins__all__against that table, so it fails until both movedocs/design/linopy.mdunder "It is not a runtime dependency" goes awayRelated: #60 (the other place the two paths visibly differ), and
docs/design/linopy.md, which was added to consolidate exactly this kind of thing.