import contract fixes - #26
Merged
Merged
Conversation
The parser stored TwoTerminalVSCLine DCSET values raw (kV for the DC-voltage-controlling side, MW otherwise), but PSY documents dc_setpoint_from/to as per-unit of rated_dc_voltage on the DC-voltage side and per-unit of baseMVA otherwise. Derive base_voltage/flow_setpoint before assigning the setpoints, emit rated_dc_voltage, and normalize dc_setpoint_from/to accordingly. Also split the ambiguous "must set a voltage control" error into distinct zero- and two-voltage-controller cases.
The switched-shunt parser stashed MODSW (control mode) and SWREM (regulated bus number) in sub_data["ext"], where PSCB's make_switched_shunt never read them. Set sub_data["control_mode"] and sub_data["regulated_bus_number"] directly instead, for both v30/32/33 and v35 sources. pti.jl's dtypes list names this column "SWREM" for every source version, including v35 where the PSS/E spec itself calls it SWREG, so a single read of switched_shunt["SWREM"] covers all versions.
…to reactive_power_required RMPCT was being mapped into the PSY field now documented as a solver output (reactive_power_required), and regulated_bus_number was never populated from FCREG (v35) / REMOT (v32/v33). v30's FACTS record layout has no REMOT field at all, so that branch falls back to 0.
RMPCT was dropped entirely from the FACTS parse path; keep it as metadata-only ext data, matching the switched-shunt policy.
_default_switched_shunt_v35 (the SWREG variant) has no references anywhere in the repo; both _pti_defaults and _pti_defaults_v35 map "SWITCHED SHUNT" to the plain _default_switched_shunt. Foot-gun for the next reader.
m-bossart
approved these changes
Jul 27, 2026
Comment on lines
+9
to
+10
| 3. the psy6 workspace root `CLAUDE.md` — workspace architecture, design decisions, seams, and the knowledge index (audit, active plans). | ||
| 4. the workspace top-level `CLAUDE.md` (one level above the psy6 root) — the two-line workspace layout and git/test policy. |
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.
No description provided.