Skip to content

Follow PowerSystems #1783 and the OpenAPI 1.x structs so the suite builds again - #301

Merged
jd-lara merged 1 commit into
jd/openapi-1x-pinsfrom
rh/openapi_1x_status_enums
Sep 14, 2026
Merged

jd-lara merged 1 commit into
jd/openapi-1x-pinsfrom
rh/openapi_1x_status_enums

Conversation

@rodrigomha

@rodrigomha rodrigomha commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Repairs the test suite on the OpenAPI.jl 1.x pins (#300), which stopped at PowerSystems #1783: must_run became commitment_mode::CommitmentModes and status::Bool became OperationalStates, with no shim. The ubuntu job of #300 ended with 454 get_must_run errors, 29 status is an OperationalStates value errors, 64 cost-coefficient method errors and 8 SwitchedAdmittance constructor errors.

Two predicates, one meaning each

  • _is_must_run, the dispatch trait the feedforwards already had, moves to utils/psy_utils.jl, next to the other PowerSystems helpers, and reads commitment_mode == MUST_RUN for ThermalGen and HydroPumpTurbine, false for anything else. The 23 PSY.get_must_run call sites go through it, and IOM.get_must_run(c::PSY.Component) = _is_must_run(c) sits next to it as the one forwarder IOM's start-up and ramp code needs; nothing is left in the feedforward or market-bid files. SELF_SCHEDULED and RELIABILITY stay committable units, the same as must_run = false before; widening that is a modeling decision for a separate PR. HydroTurbine now carries commitment_mode too but had no must_run before, so it keeps the fallback.
  • is_online(d): status is ONLINE or STARTUP. The eleven initial-condition defaults, the stored-value duration checks and the OnVariable warm start read it instead of the Bool. A unit in STARTUP counts as on, SHUTDOWN as off, and time_at_status follows that split.

Switched shunts

PowerSystems dropped SwitchedAdmittance.Y; the state is number_engaged and Y_increase, overridden by solved_admittance (PSS/E BINIT) when set. _shunt_susceptance_limits is the span the blocks can reach and _fixed_shunt_susceptance is the engaged susceptance, solved_admittance first. The tests construct with the current fields and cover the override.

Tests

set_must_run! becomes set_commitment_mode!, the seven status = true constructors and one set_status! take the enum, and test_device_reserve_offers reads the IOM predicate. The FACTS shunt test asked for control_mode = nothing, which PowerSystems still accepts but the OpenAPI 0.1.0 schema cannot encode, so the system export inside solve! failed; it now uses BYP, which leaves Q free the same way. That PowerSystems/schema disagreement is worth an upstream issue.

Fix-value parameter meta

FixValueParameter containers were stored under "$U" and read back under "$var_type": string(::Type) carries the module prefix whenever the type is not visible from Main, so the key became InfrastructureOptimizationModels.ActivePowerVariable in the test workers once the variable types moved to IOM, and the tests' nameof lookups missed. Both write sites and both read sites use nameof now, like every other feedforward meta in POM. PowerSimulations addresses that parameter by key, not by rebuilding the string.

Loss curves in the tests

PowerSystems types HVDC and converter losses as LossCurve{T, U} and rejects a bare LinearCurve; the 31 test constructions wrap their curves in LossCurve(curve, SU), which is the base the readers assumed for a bare curve, so the numbers are unchanged. The test utilities' duration checks read POM.is_online instead of the Bool status.

Cost coefficients

The 64 convert_cost_coefficient errors come from IOM calling a signature IS4 removed on 2026-09-01. InfrastructureOptimizationModels #166 fixes that; test/Project.toml pins its branch until it merges.

Upstream pieces this PR pins

None of these is POM's to fix; each is pinned from the test environment until it lands.

  • PowerSystems refuses to export a LossCurve on the component base, and rebuilds every imported loss on natural units, guards left from before the schemas had a LossCurve with power_units (SiennaSchemas Construct Device is a Runtime call #39, Consolidate approach to models with RHS time series. #43). PowerSystems #1795 into jd/openapi-1x lifts both; it clears the 55 cannot export a LossCurve in CU failures here once that branch carries it.
  • PowerFlows psy6 evaluates an HVDC loss with _eval_loss_function(::LossCurve{LinearCurve, NaturalUnit}, ::Float64), which has no method; PowerFlows jd/openapi-1x-pins (#449) already evaluates a LossCurve on its own base, so the test environment pins that branch until it merges into psy6.
  • PowerSystems exported Source.base_voltage and the ThreeWindingTransformer pairwise block as null when unstated, which the schema rejects; PowerSystems #1795's second commit omits them instead (_optional_to_wire), clearing test_tap_control, test_device_branch_constructors and test_device_source_constructors.
  • The three pins (IOM Contain type instability in G-1 outage-driven typeof dispatches #166, PowerSystems #1795, PowerFlows jd/openapi-1x-pins) return to their base branches as each merges.

Results

Local full suite on the pinned stack (PowerSystems jd/openapi-1x at ccf7889, IS4 7b14e88, OpenAPI models main 387fba3, IOM #166), Julia 1.12:

Pass Fail Error
#300 as pushed, its ubuntu job 454 get_must_run, 64 cost coefficient, 29 Bool status, 8 shunt, 4 set_must_run!
this branch, before the loss-curve wraps 123,683 12 85
this branch (2e47663) 125,732 66 23
this branch with PowerSystems #1795 (loss basis only) 126,441 14 14
this branch with PowerSystems #1795 (both commits) 129,115 5 9
this branch with PowerSystems #1795 and PowerFlows jd/openapi-1x-pins 129,137 0 0

With PowerSystems #1795 and PowerFlows jd/openapi-1x-pins, both pinned from test/Project.toml as temporary pins alongside IOM #166, the suite passes in full. Without it, 11 files fail, every one on the "Left for upstream" list: 55 cannot export a LossCurve in CU, 20 PowerFlows _eval_loss_function, the same 9 schema failures, the solver-status assertions that follow a failed export, and one PowerSystemCaseBuilder document (sys10_pjm_ac_dc) that names a time_series.h5 sidecar its serialized cache does not contain.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XgUkJVy9F23R3G5F8XFaLj

…ilds again

PowerSystems #1783 replaced must_run with commitment_mode and the Bool status with
OperationalStates, and left no shim. The feedforwards' _is_must_run trait moves to
utils/psy_utils.jl and reads commitment_mode == MUST_RUN for ThermalGen and
HydroPumpTurbine (false for anything else, so SELF_SCHEDULED and RELIABILITY stay
committable); is_online reads status as ONLINE or STARTUP. The 23 must-run sites and the
eleven Bool status reads go through them, as do the test utilities' duration checks, and
IOM.get_must_run forwards to the trait for IOM's own start-up and ramp code.

SwitchedAdmittance lost its Y field: the shunt model spans the blocks and takes
solved_admittance, else the engaged blocks, as the fixed susceptance. FixValueParameter
metas were string(::Type), which carries the module prefix in the test workers now that
the variable types live in IOM; the four sites use nameof like the other feedforward
metas. Tests construct with the enums and the current shunt fields, wrap their HVDC and
converter losses in LossCurve on the component base the readers documented, and the FACTS
shunt test asks for BYP instead of a nothing mode the OpenAPI 0.1.0 schema cannot encode.

The test environment pins InfrastructureOptimizationModels to rh/cost_coefficient_ratio
(IOM #166) until it merges: IOM main still calls the convert_cost_coefficient signature
InfrastructureSystems removed.
@rodrigomha
rodrigomha force-pushed the rh/openapi_1x_status_enums branch from 08b3349 to 2e47663 Compare September 14, 2026 17:58
@jd-lara
jd-lara self-requested a review September 14, 2026 20:40
@jd-lara
jd-lara merged commit d832972 into jd/openapi-1x-pins Sep 14, 2026
1 of 6 checks passed
rodrigomha added a commit that referenced this pull request Sep 14, 2026
… the OpenAPI 1.x line

Brings main and the #1783 repair (#301) to the market-models branch and moves every
environment to the 1.x line: InfrastructureSystems IS4, PowerSystems jd/openapi-1x (with
#1795), the PowerOpenAPIModels subpackages on main, PowerSystemCaseBuilder,
PowerFlowFileParser and PowerTableDataParser on jd/openapi-1x. Two pins stay temporary:
IOM rh/market_models_1x (jd/market_models2 plus main, IOM #167) until that merge lands,
and PowerFlows jd/openapi-1x-pins (#449) for the LossCurve reader.

Conflicts: the template gains both new fields (market_model, events) and both validation
blocks (the market network check, the outage-event discovery); the IOM.get_must_run
forwarder in market_bid_plumbing.jl goes, since the repair implements it on the
_is_must_run trait in psy_utils.jl; the pin files take the 1.x side.
rodrigomha added a commit that referenced this pull request Sep 14, 2026
… the OpenAPI 1.x line

Brings main and the #1783 repair (#301) to the market-models branch and moves every
environment to the 1.x line: InfrastructureSystems IS4, PowerSystems jd/openapi-1x (with
#1795), the PowerOpenAPIModels subpackages on main, PowerSystemCaseBuilder,
PowerFlowFileParser and PowerTableDataParser on jd/openapi-1x. Two pins stay temporary:
IOM rh/market_models_1x (jd/market_models2 plus main, IOM #167) until that merge lands,
and PowerFlows jd/openapi-1x-pins (#449) for the LossCurve reader.

Conflicts: the template gains both new fields (market_model, events) and both validation
blocks (the market network check, the outage-event discovery); the IOM.get_must_run
forwarder in market_bid_plumbing.jl goes, since the repair implements it on the
_is_must_run trait in psy_utils.jl; the pin files take the 1.x side.
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.

2 participants