Repository navigation
Rename Switch.closed to Switch.default_closed (schema 0.3.0) - #12
Merged
Merged
Conversation
Switch states fix the topology, so they belong in the grid description, but the stored value is only the switch's default state (for example the normal operating state a DSO documents). The state of a calculation is a calculation input: branch_states overrides it per solve or assembly without editing the grid. The field name and its description now say so. Compatibility: a mode="before" validator on Switch reads the pre-rename key `closed` as `default_closed` (with a DeprecationWarning) and rejects both keys with different values; the grid always serialises `default_closed`. A schema 0.2.0 reader rejects the new key (extra="forbid"). SCHEMA_VERSION goes from 0.2.0 to 0.3.0; a persisted 0.2.0 dataset reads with the minor-drift warning. Every reader of the field moves to the new name: topology, fusion, Y-bus assembly, the branch-state copy in the solver, the numpy and OpenDSS oracles, and the pandapower and power-grid-model converters and exporters. Tests cover loading a grid JSON with the old key, re-serialising it with the new one, and the contradiction error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch states fix the topology, so they belong in the grid description, but the stored value is only the switch's default state (for example the normal operating state a DSO documents). The state of a calculation is a calculation input: branch_states overrides it per solve or assembly without editing the grid. The field name and its description now say so.
Compatibility: a mode="before" validator on Switch reads the pre-rename key
closedasdefault_closed(with a DeprecationWarning) and rejects both keys with different values; the grid always serialisesdefault_closed. A schema 0.2.0 reader rejects the new key (extra="forbid"). SCHEMA_VERSION goes from 0.2.0 to 0.3.0; a persisted 0.2.0 dataset reads with the minor-drift warning.Every reader of the field moves to the new name: topology, fusion, Y-bus assembly, the branch-state copy in the solver, the numpy and OpenDSS oracles, and the pandapower and power-grid-model converters and exporters. Tests cover loading a grid JSON with the old key, re-serialising it with the new one, and the contradiction error.