1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Network topology: the node/switch graph, and the reductions over it.
//!
//! Two layers, with a deliberate separation between them.
//!
//! [`reduction`] is the older one and is unchanged: union-find, group
//! compaction, and the zero-impedance clamp. It answers "these things are
//! electrically the same point, collapse them", and it is importer-agnostic
//! because both importers can reach a network needing it.
//!
//! [`model`] and [`mod@bus_view`] are the newer one. They hold a **node-breaker**
//! description — connectivity nodes and the switches between them — and derive
//! an electrical bus view from it under a [`RetentionPolicy`]. That is the
//! layer that lets a switch keep its identity instead of being consumed at
//! import.
//!
//! The distinction that matters: `reduction` merges *unconditionally*, so a
//! merged connection is gone. `bus_view` merges *selectively*, so a retained
//! switch survives into the solver as an element with a flow and a state. The
//! default policy is [`RetentionPolicy::MergeAll`], which reproduces the older
//! behavior exactly — and is required to, since every CGMES fixture asserts
//! against it.
//!
//! # Index spaces
//!
//! [`NodeIdx`] and [`BusIdx`](model::BusIdx) are different
//! things and this module keeps them
//! different in the type system. `src/cgmes.rs` carries a comment describing a
//! real bug where pre-merge and post-merge indices were confused and
//! `AngleRefTopologicalNode` resolution picked an unrelated node; both were
//! `usize`, so nothing caught it. Making `bus_of[node]` the only well-typed
//! direction removes that whole class of mistake.
pub use ;
pub use ;
// The reduction layer's items keep their historical `topology::` paths, so no
// existing caller moves.
pub use ideal_connection_z;
pub use ;