Repository navigation
Conversation
This was referenced Oct 26, 2026
Every case is parsed by PowerIO instead of ExaPowerIO, so any single-phase network PowerIO reads (MATPOWER, PSS/E, PowerModels JSON, pandapower, CGMES, ...) becomes an OPF case, and a network already parsed with PowerIO can be passed wherever a file name was. ExaPowerIO is no longer a dependency; the PGLib-OPF artifact it provided is declared here, with the same tree hash. `parse_ac_power_data` reads `PowerIO.to_powerdata(net, T)` and keeps what is in service, in file order, as named isbits row types with ExaPowerIO's field names, so no model body changes. It matches ExaPowerIO 0.3.4 field for field on every PGLib-OPF case, except that `va` is in radians, storage is remapped to model bus positions, and a lost reference bus moves to the largest-Pmax generator (ExaPowerIO compared PMIN). A load curve no longer scales bus shunts (madsuite-org#52). The MATPOWER writer refuses a solution whose row counts do not match the case file. The compiled library parses with `parse(BalancedNetwork, path)` and the positional `to_powerdata(net, T)`, which pass `juliac --trim=safe` from eigenergy/PowerIO.jl#184; PowerIO is pinned to that branch until 0.11.7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parser_tests.jl covers inference of the arguments a compiled library builds, in-service selection and renumbering on an edited case14, each refusal, the implied thermal limit against PowerModels, pre-parsed and updated networks, PowerModels JSON and PSS/E round trips, case lookup, and the multi-period load contract. PGLib cases by name are solved against PowerModels, and DC OPF against DCPPowerModel through the unused `test_dcopf_case`. An `aot` slice runs `test_aot`, now compiling into a temporary directory, with a case loaded by path, so a regression in the trimmed case reader fails CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PowerIO.jl #184 now returns the value from parse(BalancedNetwork, path), as
parse(T, str) does in Base, and the module from parse(PioModule{V}, path). The
case reader drops its `.value`; the tests that emit or apply updates ask for
the module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s VA in radians The parse now gives va0 in radians, so case_start must not convert it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sshin23
force-pushed
the
powerio-0.11-cases
branch
from
November 17, 2026 00:26
109d164 to
65881d2
Compare
sshin23
marked this pull request as ready for review
November 17, 2026 00:26
Member
|
Continued in #76, from a branch in this repository so the Claude review workflow can run. It carries these commits rebased onto main, plus the follow-ups described there. |
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.
Cases are now read through PowerIO.jl instead of ExaPowerIO. Any single-phase network PowerIO reads becomes an OPF case: MATPOWER, PSS/E RAW/RAWX, PowerModels JSON, pandapower, PowerWorld, CGMES, XIIDM, and more. ExaPowerIO is no longer a dependency. This replaces #60, which targeted PowerIO 0.9; almost none of the API it used exists in 0.11. Issue #52 is fixed here.
How a case is read
Lookup: a path, or a bare PGLib-OPF name (
pglib_opf_*.m, alsoapi/…andsad/…). Names resolve in the same lazy PGLib-OPF v23.07 artifact ExaPowerIO used, now declared in this package'sArtifacts.toml. It has the same tree hash, so existing depots reuse the download. A missing path that isn't a PGLib name is anArgumentErrorand no longer triggers the download.Pre-parsed networks: anywhere a file name was accepted, a network already parsed with PowerIO works too:
PowerIO.parse(BalancedNetwork, path; format), or its modulePowerIO.parse(PioModule{BalancedNetwork}, path), possibly edited withPowerIO.apply_updates!.Parsing:
parse_ac_power_datacallsPowerIO.to_powerdata(net, T), then keeps what is in service, in file order:rateA = 0(or a non-finite rating) becomes the limit implied by the voltage and angle bounds, as ExaPowerIO 0.3.2 does.The rows are named isbits NamedTuple types with ExaPowerIO's field names and order, so no model body changed. Empty tables stay concrete for GPU
convert_array.Parity: against ExaPowerIO 0.3.4, every field of every table matches to 1e-12 on all 66 top-level PGLib-OPF v23.07 cases and the 5 fixtures in
data/. The exceptions areva, now in radians, and the reference-bus choice described below.Ahead-of-time compilation
compile_allruns the case reader inside ajuliac --trim=safelibrary. PowerIO 0.11.6 fails trim verification (90 errors: a value type picked at run time, untyped handle locks, a keyword element type). eigenergy/PowerIO.jl#184 adds:parse(BalancedNetwork, path), which returns the network asparse(T, str)does in Base;to_powerdata(net, T);With it, the
:acplibrary verifies and links, and itsobj/consmatch the in-Julia model exactly on case14 (by path) and on case30 andapi/case14(by PGLib name). This PR adds anaotCI slice so a regression shows up. A compiled library can't download the PGLib artifact; that was already true with ExaPowerIO, andtest_aotnow resolves the name in Julia first.PowerIO 0.11.7 and later are registered, so the branch pin is gone; compat is
PowerIO = "0.11.7, 0.12". With PowerIO 0.12.1, theaotslice passes on Julia 1.13.2 (31/31); on Julia 1.12.7 trim verification fails (also with PowerIO 0.11.12), mostly on PkgREPLExtcode reached throughLazyArtifacts.Behavior changes (0.5.0)
storage_busis the model position of the bus; it was the raw MATPOWER bus number, which indexed the wrong bus whenever numbering wasn't 1..n. Storagep_loss/q_lossare per unit, as in ExaPowerIO 0.3.4.pd/qdonly; bus shunts (gs,bs) keep their value. The Pd/Qd matrix path already did this. Nothing in the test fixtures has a shunt, so the hard-coded objectives are unchanged.ArgumentError; before, it silently got bus index 0;ArgumentError; before, its breakpoints were read as polynomial coefficients.N, Pd/Qd with the wrong number of rows, mismatched Pd/Qd, or too few periods raiseDimensionMismatchinstead of aBoundsErroror an@assert.va0is in radians. It was degrees, so a warm startstart = (va = d -> d.va0,)was off by 180/π. The default starts don't use it.DimensionMismatch), and a non-MATPOWER case file (ArgumentError). Before, it could write values into the wrong rows.Tests
test/parser_tests.jl(thenothingslice):opf_args(path and pre-parsed),mpopf_args_defaultand positionalmpopf_args; isbits rows, empty tables included;rateA = 0against PowerModels'calc_thermal_limits!;rtol = 1e-6). DC OPF case3/5/14 against PowerModels'DCPPowerModel, through the previously unusedtest_dcopf_case.aotCI slice:test_aot(theEMP_TEST_AOTopt-in still works), plus a case loaded by path in the rectangular form.Verification (local, Julia 1.13.1, macOS)
EMP_TEST_SELECTION=nothing: 808 passed.cpu: 450 passed.aot: 19 passed, with all six models compiled under--trim=safe.cudaslice needs the self-hosted runners.goc3slice is untouched here. The GOC3 path moves to PowerIO in a separate PR.Rebased onto main (0.4.8)
Project.toml,src/opf.jl,src/ExaModelsPower.jl,test/runtests.jl; the parser tests run next to the violations, case-start and zero-compile tests.case_start(from Start from the case's operating point: start = :case, case_start, compiled start writer #72) convertedva0from degrees; withva0now in radians it is used as is.nothing868/868 (Julia 1.12.7);cpu458/459, the one failure being the POCL zero-compile check foropf_violationsthat also fails on main;aot31/31 (Julia 1.13.2).cuda,goc3and docs were not run locally.🤖 Generated with Claude Code