Repository navigation
feat(dist): read CIM16 LV feeders with text enumerations and a Diagram Layout - #768
Conversation
…m Layout A CIM16 LV feeder stated with sequence impedances and no per phase class routed to the CGMES reader and failed, and read with an explicit `cim-dist` token it gave three phase switches for its single phase fuses. - Route a header-less CIM document with the IEC 61968 customer classes (`ServiceLocation`, `UsagePoint`) to `cim-dist`. - Read an enumeration stated as text (`<cim:Terminal.phases>A</...>`) like a reference. - Take a segment's ampacity from the `WireInfo.ratedCurrent` its `AssetDatasheet` names. - Read the Diagram Layout: a segment's `DiagramObjectPoint`s are its route, and a bus takes the end of the first segment at its node, else the point of the equipment there or of the composite switch that holds a switch. A diagram that names an `EPSG:` code sets the network's coordinate reference system. - Default a CIM16 document set without a `BaseFrequency` to 50 Hz, as the CGMES reader does. - Report `Circuit`, `CompositeSwitch`, and `PSRType` as context. The new tests pin a synthetic CIM16 feeder: its mapping, its layout, and its conversion to OpenDSS, PMD, BMOPF, and a byte stable CIM rewrite.
|
The two failing checks on this PR come from
This PR does not touch the PMD fixtures, the BMOPF writer or |
frederikgeth
left a comment
There was a problem hiding this comment.
Requesting changes on reviewed head ace01e9444e78552aaa8c154890f881e47be61e3 for two P2 silent-data-loss findings, attached inline:
- Diagram objects for connectivity nodes or terminals are consumed without applying their coordinates or reporting the loss.
- An invalid stated WireInfo.ratedCurrent is consumed and discarded without a rating diagnostic.
Validation: 299 distribution unit tests, 47 CIM integration tests and 11 tank-safety tests passed (12 existing unit ignores). Two supplemental regression tests fail on this head and pass with the parent reader. Both also pass with a local diagnostic-only proof fix; the complete focused suites then pass 359 tests. The proof changes were not committed or pushed, and tracked source was restored.
The existing hosted Validation failures are the inherited PMD/BMOPF schema and network-TimeSeries issues, and the Julia binding check uses the stale companion pin. Refresh/recheck after #744's repairs land. #769 depends on this PR; #770 is independent.
No other actionable finding in the reviewed scope. No merge was performed.
There was a problem hiding this comment.
🟡 Changes recommended
Active issues leave ConnectivityNode bus coordinates unset while suppressing loss reports and misclassify geographic CRSs such as EPSG:4258 as projected, causing coordinates to be discarded during conversion.
2 open issues
What changed in this PR
Extends the distribution CIM reader to handle CIM16 low-voltage feeders through the shared multiconductor model and existing writers.
Changes:
- Routes header-less CIM documents with customer classes to
cim-distand reads text enumerations and wire ampacity. - Maps Diagram Layout coordinates to routes and bus locations, and defaults CIM16 inputs without a stated frequency to 50 Hz.
- Adds synthetic feeder tests for mapping, layout, and distribution-format conversions, with updated documentation.
| File | Description |
|---|---|
powerio/src/lib.rs |
Updates the routing comment to mention customer classes. |
powerio-dist/tests/cim.rs |
Adds CIM16 mapping, layout, and conversion tests. |
powerio-dist/src/cim/read.rs |
Implements text enums, ampacity, layout, frequency defaults, and context handling. |
powerio-dist/src/cim/mod.rs |
Adds customer-class routing markers and a routing test. |
docs/src/format-fidelity.md |
Documents expanded distribution CIM routing. |
docs/src/distribution.md |
Documents supported CIM16 mappings and defaults. |
CHANGELOG.md |
Records the new reader capabilities. |
Review effort: Balanced
A diagram's EPSG code other than 4326 no longer reads as projected on that alone. Widely used geographic codes such as EPSG:4258 read as longitude and latitude, so the PMD writer keeps their coordinates. Any other code is projected when a coordinate lies outside the range of degrees; otherwise the space stays undeclared with a finding naming the code. A ConnectivityNode or Terminal drawing now gives its bus a location, ahead of those derived from equipment. Diagram objects and points are consumed only once their coordinates reach the network, so any other drawing is reported unmapped instead of disappearing.
A negative, zero, non-finite, or unparsable WireInfo.ratedCurrent read as an absent rating with no finding. It now draws a VALUE_UNSUPPORTED finding, once per catalog entry, while an absent rating stays silent.
# Conflicts: # CHANGELOG.md
…m Layout # Conflicts: # CHANGELOG.md # powerio-dist/tests/cim.rs
|
This PR is folded into #821 through |
…m Layout # Conflicts: # CHANGELOG.md # powerio-dist/tests/cim.rs

Summary
A CIM16 LV feeder stated with sequence impedances and no per phase class routed to the CGMES reader and failed ("CGMES profile set is missing required EQ profile data"). Read with an explicit
cim-disttoken, it gave three phase switches for its single phase fuses and defaulted to 60 Hz. This PR makes thecim-distreader read such feeders intoMulticonductorNetwork, so they convert to every distribution format through the shared writers. No writer changes.ServiceLocation,UsagePoint) and no CGMESmd:FullModelheader routes tocim-dist.<cim:Terminal.phases>A</cim:Terminal.phases>) reads like theEnumClass.valuereference form.i_maxfrom theWireInfo.ratedCurrent(or a subclass) itsPowerSystemResource.AssetDatasheetnames.DiagramObjectPoints, insequenceNumberorder, are its route. A bus takes the end of the first segment at its node, else the point of the equipment there or of the composite switch that holds a switch (marked derived). A diagram that names anEPSG:code sets the network's CRS. PowerIO does not reproject.BaseFrequencyreads at 50 Hz, the ENTSO-E default the CGMES reader also assumes. CIM100 keeps 60 Hz. Either default is aREAD.CIM_DIST.VALUE_DEFAULTEDfinding.Circuit,CompositeSwitch,PSRType, andSwitch.CompositeSwitchare reported as context.ServiceLocationandUsagePointare still unmapped classes.Tests
powerio-dist/tests/cim.rsadds a synthetic CIM16 feeder: source, cable, three single phase fuses in a composite switch, a phase B fuse, two consumers, customer classes, and a GIS diagram, all with invented names, values, and coordinates. No fixture files are added. The tests pin:All three tests fail on
mainand pass here.cargo test: 3405 passed, 0 failed.cargo clippy -p powerio-dist --all-targets --all-features -- -D warnings: clean.scripts/ci-clippy.shstops atfloat_cmpin files this PR does not touch (powerio-tx/src/format/psse.rs,powerio/tests/ac_ots.rs,powerio/tests/partial_transformer_ir.rs).mainpasses CI on current stable.A follow-up PR maps the Schneider Electric ADMS extension of CIM16 on top of this one.