Skip to content

feat(dist): map the Schneider Electric ADMS extension of CIM16 - #769

Draft
MohamedNumair wants to merge 6 commits into
eigenergy:mainfrom
MohamedNumair:dist/cim16-sedms
Draft

MohamedNumair wants to merge 6 commits into
eigenergy:mainfrom
MohamedNumair:dist/cim16-sedms

Conversation

@MohamedNumair

@MohamedNumair MohamedNumair commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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.rs maps the extension into MulticonductorNetwork, so the network converts to every distribution format through the shared writers. No writer changes.

Extension Model
UsagePoint at a ServiceLocation (sedms:ServiceLocation.Terminal, .phases; sedms:UsagePoint.p, .q) one load per usage point, its powers shared evenly over the location's phases: wye or single phase with the neutral, delta or phase to phase without it
FlexibleLoad (sedms:FlexibleLoad.Customer, pMax, pAvg, dispatchable, resourceType) an inverter based resource at the customer's location. One that is not dispatchable holds pAvg at unity power factor
ConnectivityNode with sedms:ConnectivityNode.stitchingInfo, when no EnergySource exists a sourcebus joined through closed switches to the stitched nodes, with an ideal source at their sedms:ConductingEquipment.ratedVoltage
Diagram Layout service location points for nodes no equipment places; sedms:Diagram.type GIS as projected coordinates; the supply busbar at the centroid of the nodes it feeds
  • Gating. The mapping runs only when a document uses the extension namespace (xml.rs gives those properties the sedms: prefix by URI). Without it, ServiceLocation and UsagePoint stay unmapped classes, as in feat(dist): read CIM16 LV feeders with text enumerations and a Diagram Layout #768.
  • Findings. Every value the extension fills in is a READ.CIM_DIST.* finding.
  • Reader hooks. read.rs gains a wye_source helper, shared by EnergySource and the placed supply, and a terminal_usage helper. It also gains IBRs and supply busbars in the bus derivation.

Tests

powerio-dist/tests/cim.rs adds 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.

…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.
@MohamedNumair

MohamedNumair commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

The two failing checks on this PR come from main, not from this change. validate fails the same way on #766 and #767. #744 fixes both, and both checks pass on that PR.

This PR does not touch the PMD fixtures, the BMOPF writer or powerio-capi. Once #744 merges I will merge main into this branch to rerun the checks.

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.
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.
@samtalki samtalki mentioned this pull request Nov 7, 2026
@MohamedNumair
MohamedNumair requested a balanced review from Copilot and removed request for samtalki November 10, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

No deployments
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