Skip to main content

Module indexed

Module indexed 

Source
Expand description

IndexedNetwork: the dense-indexed analysis view over a Network.

Network is the canonical data record — format-neutral tables with no analysis behavior. The matrix builders, connectivity diagnostics, and the DC-OPF instance need things a plain table doesn’t carry: a dense [0, n) bus index, demand and shunts aggregated per bus, the in-service subsets, and the reference bus. IndexCore derives those once from a borrowed &Network; IndexedNetwork pairs that core with the network and answers the queries. Keeping this off Network is what stops Network from turning into a god type: data on one side, derived analysis on the other.

The derived core is one HashMap and four Vec<f64>. One-shot callers use IndexedNetwork::new, which builds and owns a throwaway core. A long-lived handle (the Python and C ABI wrappers) builds an IndexCore once at parse time and rebinds a borrowing view per query with IndexedNetwork::with_core, so repeated queries never re-fold the loads and shunts.

Structs§

ConnectivityReport
Topological invariants the TUI Inspect screen and downstream solvers care about.
IndexCore
The owned, network-independent derivation behind IndexedNetwork: the dense bus-id map plus the per-bus demand/shunt aggregates. Build it once with IndexCore::build and reuse it across many IndexedNetwork::with_core views of the same Network.
IndexedNetwork
A Network paired with its derived IndexCore. Borrows the network; the core is either owned (the one-shot IndexedNetwork::new) or borrowed from a cached IndexCore (IndexedNetwork::with_core).