Skip to content

Read bus voltages with explicit units (PowerSystems.jl#1823 fallout) - #335

Open
luke-kiernan wants to merge 1 commit into
mainfrom
lk/voltage-units-1821
Open

luke-kiernan wants to merge 1 commit into
mainfrom
lk/voltage-units-1821

Conversation

@luke-kiernan

Copy link
Copy Markdown
Collaborator

Companion to Sienna-Platform/PowerSystems.jl#1823 (merged), which makes bus magnitude/voltage_limits unit-bearing. After a Pkg.update, the 1-arg getters throw and the ACBus(; ...)/DCBus(; ...) keyword constructors require input_basis.

Changes

  • src: every get_magnitude/get_voltage_limits on a bus now passes PSY.CU (network models, HVDC, shunts, regulated voltage, branch bounds). CU is per-unit on the bus base voltage, which is exactly what the 1-arg getter returned before, so no model changes. (Voltage per-unit is also the same in CU and SU.)
  • test: the same accessor change, input_basis = PSY.CU on 10 bus keyword constructors, and a named (min = ..., max = ...) tuple for voltage_limits in mbc_math_helpers.jl. The keyword constructor rejects unnamed tuples for unit-bearing compound fields.

Warning

Revert before merging: test/Project.toml pins PowerSystemCaseBuilder and PowerFlows to rev = "lk/voltage-units-1821". Set them back to rev = "psy6" once Sienna-Platform/PowerSystemCaseBuilder.jl#233 and Sienna-Platform/PowerFlows.jl#462 merge. Both need the same fix: PSB's builders construct buses by keyword, and PF's init reads get_magnitude.

Testing

Full suite: 128510 passed. The only failures were in test_power_flow_in_the_loop, where PF psy6 calls 1-arg get_magnitude. With PF pinned to #462 that file is 872/873. The remaining error, at line 712, predates this PR: the test passes ACPolarPowerFlow(; solver_settings = ...), a keyword PF psy6 doesn't define.

🤖 Generated with Claude Code

PowerSystems.jl#1823 made bus magnitude/voltage_limits unit-bearing:
getters need an explicit unit and the ACBus/DCBus keyword constructors
need input_basis. CU returns the same per-unit-on-bus-base values as
before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Performance Results

Version Precompile Time
Main 2.793298013
This Branch 2.789450836
Version Build Time
Main-Build Time Precompile 81.096503621
Main-Build Time Postcompile 1.171794769
This Branch-Build Time Precompile 80.941669098
This Branch-Build Time Postcompile 1.155032158
Version Solve Time
Main-Solve Time Precompile 112.458315864
Main-Solve Time Postcompile 87.16366463
This Branch-Solve Time Precompile 594.304009141
This Branch-Solve Time Postcompile 554.521680926

This branch has not been deployed

No deployments
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.

1 participant