dist: BMOPF schema 0.1.0 alignment - #264
Open
samtalki wants to merge 3 commits into
Open
Conversation
Track bmopf-report PR #16 (schema 0.1.0): meta case_study_generator + frequency, uppercase load model enum, per-sequence bus voltage bounds replacing the vsym arrays (multiconductor payload bumps to /2, 2.0.0), lumped three phase transformer series impedance referred per winding rating, transformer taps/neutral/no-load and the IBR, control profile, DC, and time series tables relocated under the extras escape hatch, a typed capacitor element, inline line impedance via a synthesized linecode, line i_max/s_max, and one-triangle symmetric matrix mirroring on read. The reader keeps accepting every pre-0.1.0 spelling. The vendored schema and example networks track bmopf-report@f2e3684; a regen_bmopf_examples example rebuilds the checked-in outputs. Grounded terminals now count as referenced in the unused-terminal prune, so standalone grounding survives a write. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Conversion MatrixLegendCells show
Transmission7 cases.
Distribution7 cases.
Full warning details: download |
There was a problem hiding this comment.
Pull request overview
Aligns PowerIO’s distribution (multiconductor) BMOPF read/write paths with bmopf-report BMOPF schema 0.1.0, while preserving backward compatibility for older (“pre-0.1.0”) spellings and improving round-trip fidelity through extras.
Changes:
- Update BMOPF JSON IO to schema 0.1.0 conventions (meta/frequency, uppercase load models, per-sequence voltage bounds, transformer overflow relocation, one-triangle matrix mirroring, inline line impedance support, etc.).
- Introduce typed
DistCapacitor, plus per-linei_max/s_max, and bump multiconductor payload schema topio-payload-multiconductor/2(2.0.0). - Re-vendor/regenerate BMOPF example fixtures and update conversion-matrix baselines + tests to match the new canonicalization/compat behavior.
Reviewed changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/data/dist/bmopf/example_ieee13.json | Updates vendored BMOPF IEEE13 fixture to schema 0.1.0 structure/fields. |
| powerio-pkg/src/package.rs | Bumps multiconductor payload schema URL to /2 and version to 2.0.0. |
| powerio-pkg/src/lowering.rs | Updates lowering “dropped voltage bound family” detection to new per-sequence fields. |
| powerio-pkg/examples/generate_schemas.rs | Generates schema for pio-payload-multiconductor/2. |
| powerio-dist/tests/rich.rs | Updates tests to expect uppercase BMOPF load model strings. |
| powerio-dist/tests/matrix.rs | Adjusts round-trip expectations (terminal renumbering, grounding usage, idempotence convergence). |
| powerio-dist/tests/bmopf.rs | Updates fixture validation expectations and adds one-triangle symmetric matrix mirroring coverage. |
| powerio-dist/src/pmd/write.rs | Warns and drops typed capacitor during PMD ENGINEERING writes. |
| powerio-dist/src/pmd/read.rs | Initializes new DistLine limit fields (i_max/s_max) on read. |
| powerio-dist/src/model.rs | Adds per-sequence bus bounds, per-line limits, and typed DistCapacitor to the distribution model. |
| powerio-dist/src/lib.rs | Re-exports DistCapacitor. |
| powerio-dist/src/dss/write.rs | Warns and drops typed capacitor during DSS writes; propagates new line limit fields in tests. |
| powerio-dist/src/dss/read.rs | Initializes new DistLine limit fields (i_max/s_max) on read. |
| powerio-dist/src/bmopf/write.rs | Implements BMOPF schema 0.1.0 writer behavior (meta/frequency, extras relocation, new bounds, line limits, capacitor table, transformer overflow split). |
| powerio-dist/src/bmopf/read.rs | Implements schema-compat reader behavior (meta frequency, extras folding, new bounds + legacy mapping, one-triangle matrix mirroring, inline line impedances, typed capacitors). |
| powerio-dist/examples/regen_bmopf_examples.rs | Adds helper example to regenerate checked-in BMOPF example outputs. |
| powerio-dist/examples/bmopf/ieee34.json | Regenerated BMOPF IEEE34 example output matching schema 0.1.0 + canonicalization. |
| powerio-dist/examples/bmopf/ieee123.json | Regenerated BMOPF IEEE123 example output matching schema 0.1.0 + canonicalization. |
| powerio-dist/examples/bmopf/4bus_dy.json | Regenerated BMOPF 4bus output matching schema 0.1.0 + canonicalization. |
| powerio-dist/docs/conversion-matrix.md | Updates conversion warning counts/baselines to reflect the new behavior and fixtures. |
| powerio-cli/tests/conversion_matrix_report.rs | Updates CLI conversion warning baseline matrix for schema 0.1.0 behavior. |
| docs/src/pio-json-schema.md | Documents the pio-payload-multiconductor/2 schema and legacy /1 availability. |
| docs/schema/pio-package/0.1/schema.json | Updates generated package schema to include new fields/types (bounds, line limits, capacitors). |
| CHANGELOG.md | Adds an Unreleased entry describing BMOPF schema 0.1.0 alignment and related model/schema changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
samtalki
added a commit
to eigenergy/PowerIO.jl
that referenced
this pull request
Jul 22, 2026
Taps live under the extras escape hatch and three phase transformers carry one lumped series pair (eigenergy/powerio#264). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-up on the BMOPF 0.1.0 alignment: the new DistLine i_max/s_max fields wrote BMOPF but vanished silently through the dss and PMD writers, against the fidelity policy. - The PMD ENGINEERING line has its own cm_ub/sm_ub slots, so the line ratings now map both directions: the reader takes line-level cm_ub/sm_ub into the typed fields (an inline-impedance line's ratings stay on the synthesized linecode, whose sm_ub now re-inlines alongside cm_ub), and the writer emits them back. - The dss writer warns when it drops line i_max/s_max; the normamps/emergamps mapping decision stays with #266. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YPB7LVTeMcdBYnzA9QdpPe
A PMD source spells an unbounded phase as JSON null, which restores as Inf in the model; the writer's num zero fallback then turned "no limit" into a zero limit. Line and switch i_max/s_max now go through a bounds guard that drops the field with a warning when any entry is nonfinite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YPB7LVTeMcdBYnzA9QdpPe
This was referenced Jul 23, 2026
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.
Tracks the BMOPF schema 0.1.0 merged in distribution-system-opt/bmopf-report#16. The writer targets the published schema
$id; the reader keeps accepting every pre-0.1.0 spelling.Schema-driven changes:
metacarriescase_study_generator(wasgenerator) and the systemfrequency.modelenum strings are uppercase.vpos_min/vpos_max/vneg_max/vzero_max/vn_max; legacyvsym_*arrays map on read (zero/positive/negative order) with warnings for the bounds 0.1.0 cannot carry. TheDistBusrename bumps the multiconductor payload topio-payload-multiconductor/2(2.0.0);/1stays served.r_series/x_seriespair on the wye base, each winding's percent resistance referred to its own rating before the sum (identical to the previous form for equal ratings). The split_from/_tofields lost their slots.extras.transformer.<subtype>.<name>; the IBR, control profile, DC, and time series tables relocate underextrasthe same way. The reader folds all of them back, so the dss round trips keep their fidelity.capacitorelement (DistCapacitor). The DSS converter still lowers OpenDSS capacitors to shunt matrices; dss/PMD writers drop typed capacitors with a warning (conversion tracked in the follow-up issue).i_max/s_max.The vendored schema and example networks are byte identical to bmopf-report@f2e3684, and
cargo run -p powerio-dist --example regen_bmopf_examplesregenerates the checked-in example outputs (they had gone stale at v0.2.4). Conversion matrix baselines updated: dss→BMOPF warnings drop 187→132 (relocated fields ride along instead of dropping), and the BMOPF source rows reflect the new fixtures.🤖 Generated with Claude Code