Repository navigation
feat(dist): map the Schneider Electric ADMS extension of CIM16 - #769
Draft
MohamedNumair wants to merge 6 commits into
Draft
MohamedNumair wants to merge 6 commits into
MohamedNumair wants to merge 6 commits into
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.
A Schneider Electric ADMS exports an LV network as a header-less CIM16 document with its own extension namespace (`http://www.schneider-electric-dms.com/CIM16v33/2017/extension`). Its customers and generation are stated only through extension properties, and it leaves out the source, so the standard CIM16 mapping reads such a network with no loads, no generation, and no supply. The new `cim/read/sedms.rs` module maps the extension into the multiconductor model, so the network converts to every distribution format through the shared writers: - a load per `UsagePoint` at the bus of the terminal its `ServiceLocation` is served from, on the location's phases, with the stated `p` and `q`; - an inverter based resource per `FlexibleLoad`, at its customer's location, holding its average output when it is not dispatchable; - when the documents define no `EnergySource`, a busbar joined through closed switches to the nodes `sedms:ConnectivityNode.stitchingInfo` marks, with an ideal source at their rated voltage; - in the Diagram Layout, service location points for nodes no equipment places, a GIS diagram as projected coordinates, and the supply busbar at the centroid of the nodes it feeds. The reader applies the mapping only when a document uses the extension namespace, and every value it fills in is a `READ.CIM_DIST.*` finding. The new tests pin a synthetic feeder in the export's form: its mapping, its layout, and its conversion to OpenDSS, PMD, BMOPF, and a byte stable CIM rewrite.
Collaborator
Author
|
The two failing checks on this PR come from
This PR does not touch the PMD fixtures, the BMOPF writer or |
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
Service location drawings count as carried once they reach a node, under the reader's rule that a drawing placing nothing is reported. A sedms GIS diagram that names no CRS stays projected.
Merged
MohamedNumair
requested
a balanced review from Copilot
and removed request for
samtalki
November 10, 2026 18:06
There was a problem hiding this comment.
🟡 Changes recommended
Active findings identify unintended electrical connections, incomplete supply energization, incorrect namespace activation, and lost customer demand or generation.
5 open issues
What changed in this PR
Adds Schneider Electric ADMS CIM16 support to the distribution reader, building on #768’s feeder support. The extension maps into MulticonductorNetwork, reusing existing format writers.
Changes:
- Maps customer demand, flexible generation, and inferred supplies.
- Adds extension namespace handling and service-location layout support.
- Documents the supported profile and adds synthetic mapping, layout, and conversion tests.
| File | Description |
|---|---|
| README.md | Advertises CIM16 ADMS input support. |
| powerio/src/lib.rs | Clarifies the routing comment for customer classes. |
| powerio-dist/tests/cim.rs | Adds synthetic CIM16 and ADMS regression tests. |
| powerio-dist/src/cim/xml.rs | Normalizes Schneider extension property names. |
| powerio-dist/src/cim/read/sedms.rs | Implements customer, generation, supply, and layout mapping. |
| powerio-dist/src/cim/read.rs | Integrates extension data and shared reader helpers. |
| powerio-dist/src/cim/mod.rs | Adds customer-class routing markers from #768. |
| powerio-dist/README.md | Describes ADMS reader support. |
| docs/src/format-fidelity.md | Documents customer-class routing from #768. |
| docs/src/distribution.md | Explains extension mappings, assumptions, and limitations. |
| CHANGELOG.md | Records ADMS support and the underlying CIM16 changes. |
Review effort: Balanced
Comment on lines
+60
to
+63
| doc.objects | ||
| .iter() | ||
| .flat_map(|object| &object.props) | ||
| .any(|(key, _)| key.starts_with("sedms:")) |
Comment on lines
+383
to
+387
| let circuits = self | ||
| .store | ||
| .text(&node, "sedms:ConnectivityNode.connectedCircuits") | ||
| .map_or_else(String::new, |c| c.trim().to_owned()); | ||
| match groups.iter_mut().find(|(c, _, _)| *c == circuits) { |
Comment on lines
+424
to
+425
| if let Some(stated) = self.terminal_phases(terminal) { | ||
| phases.extend(stated); |
| } | ||
| }; | ||
| let neutral = map.iter().any(|t| t == "4"); | ||
| let phases: Vec<String> = map.into_iter().filter(|t| t != "4").collect(); |
Comment on lines
+255
to
+274
| let n = point.phases.len(); | ||
| let (topology, map) = match (n, point.neutral) { | ||
| (1, _) => ( | ||
| IbrTopology::SinglePhase, | ||
| with_neutral(point.phases.clone(), Configuration::SinglePhase), | ||
| ), | ||
| (3, false) => (IbrTopology::ThreeLeg, point.phases.clone()), | ||
| (3, true) => ( | ||
| IbrTopology::FourLeg, | ||
| with_neutral(point.phases.clone(), Configuration::Wye), | ||
| ), | ||
| _ => { | ||
| self.drop_record( | ||
| "FlexibleLoad", | ||
| &id, | ||
| &format!("an inverter on {n} phases has no topology in the model"), | ||
| ); | ||
| continue; | ||
| } | ||
| }; |
This branch has not been deployed
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.


Depends on #768. This branch is stacked on it, so until #768 merges the diff also shows that commit. Review only the last commit,
feat(dist): map the Schneider Electric ADMS extension of CIM16.Summary
A Schneider Electric ADMS exports an LV network as a header-less CIM16 document with its own extension namespace,
http://www.schneider-electric-dms.com/CIM16v33/2017/extension. Customers, generation, and voltage levels are stated only through extension properties, and the export leaves out the source. With #768 alone, such a network reads with its wiring and layout but no loads, generation, or supply.The new
powerio-dist/src/cim/read/sedms.rsmaps the extension intoMulticonductorNetwork, so the network converts to every distribution format through the shared writers. No writer changes.UsagePointat aServiceLocation(sedms:ServiceLocation.Terminal,.phases;sedms:UsagePoint.p,.q)FlexibleLoad(sedms:FlexibleLoad.Customer,pMax,pAvg,dispatchable,resourceType)pAvgat unity power factorConnectivityNodewithsedms:ConnectivityNode.stitchingInfo, when noEnergySourceexistssourcebusjoined through closed switches to the stitched nodes, with an ideal source at theirsedms:ConductingEquipment.ratedVoltagesedms:Diagram.typeGISas projected coordinates; the supply busbar at the centroid of the nodes it feedsxml.rsgives those properties thesedms:prefix by URI). Without it,ServiceLocationandUsagePointstay unmapped classes, as in feat(dist): read CIM16 LV feeders with text enumerations and a Diagram Layout #768.READ.CIM_DIST.*finding.read.rsgains awye_sourcehelper, shared byEnergySourceand the placed supply, and aterminal_usagehelper. It also gains IBRs and supply busbars in the bus derivation.Tests
powerio-dist/tests/cim.rsadds a synthetic feeder in the export's form, with invented names, values, and coordinates. No fixture files are added. The tests pin:the mapping: loads, the IBR, the supply, and findings;
the layout;
the conversion to OpenDSS, PMD, BMOPF, and CIM: each output reparses with its source, loads, and 50 Hz, and the CIM rewrite is byte stable.
cargo test: 3408 passed, 0 failed.cargo clippy -p powerio-dist --all-targets --all-features -- -D warnings: clean.