Expand description
Typed balanced network models and format implementations.
Readers and writers cover MATPOWER .m, PowerModels JSON, PSS/E .raw,
PowerWorld .aux, pandapower JSON, PyPSA CSV, egret JSON, PSLF .epc,
PSS/E RAWX 35, PowSybl XIIDM and JIIDM 1.0 through 1.17, CIM CGMES 2.4.15 and 3.0,
Surge JSON,
and DeepMind OPFData JSON. PowerWorld .pwb, OPFData files, and the IEEE
Common Data Format are read
only. GO Challenge 3 defines a calculation and therefore parses only
through the top level powerio::parse, which returns its declared
AcScucInstance or AcScucSolution. .pwd display files parse through
the facade’s parse, which returns powerio.GeoLayer.
Each reader produces a BalancedNetwork. The top level powerio facade
owns universal parsing and emit; this component crate supplies the typed
transmission implementation.
A reader that retains source text can return those bytes when writing the same format. Matrix and problem instance builders live in separate crates.
SINCAL adapters are provided by powerio_tnd::formats::sincal and the
powerio facade. This model crate is independent of SQLite and integration.
use powerio_core::Source;
use powerio_tx::{parse, parse_format_id};
let src = "\
function mpc = example
mpc.version = '2';
mpc.baseMVA = 100;
mpc.bus = [
\t1\t3\t0\t0\t0\t0\t1\t1\t0\t230\t1\t1.1\t0.9;
\t2\t1\t0\t0\t0\t0\t1\t1\t0\t230\t1\t1.1\t0.9;
];
mpc.branch = [
\t1\t2\t0.01\t0.1\t0\t0\t0\t0\t0\t0\t1\t-360\t360;
];
";
let source = Source::from_memory("example.m", src.as_bytes().to_vec())?
.with_format(parse_format_id("matpower")?);
let module = parse(source)?;
assert_eq!(module.value().buses().len(), 2);Re-exports§
pub use contingency::AutomaticOrder;pub use contingency::AutomaticSpec;pub use contingency::AutomaticTarget;pub use contingency::BranchRef;pub use contingency::Change;pub use contingency::ChangeOp;pub use contingency::ChangeUnit;pub use contingency::ContingencyAction;pub use contingency::ContingencyCase;pub use contingency::ContingencyParsed;pub use contingency::ContingencyResolution;pub use contingency::ContingencySet;pub use contingency::DefaultDispatch;pub use contingency::DispatchBlock;pub use contingency::DispatchEntry;pub use contingency::DispatchLevel;pub use contingency::DispatchedAction;pub use contingency::Expanded;pub use contingency::InterfaceMember;pub use contingency::JoinName;pub use contingency::MonitorScope;pub use contingency::MonitorStatement;pub use contingency::MonitoredParsed;pub use contingency::MonitoredResolution;pub use contingency::MonitoredSet;pub use contingency::PsseEquipmentIndex;pub use contingency::ResolvedCase;pub use contingency::ResolvedComponent;pub use contingency::ResolvedInterface;pub use contingency::ResolvedVoltageScope;pub use contingency::RetainedStatement;pub use contingency::ScaledQuantity;pub use contingency::SelectorGroup;pub use contingency::SkipRule;pub use contingency::Subsystem;pub use contingency::SubsystemDispatchRule;pub use contingency::SubsystemParsed;pub use contingency::SubsystemSelector;pub use contingency::SubsystemSet;pub use contingency::UnresolvedAction;pub use contingency::UnresolvedMonitor;pub use contingency::UnresolvedMonitorReason;pub use contingency::UnresolvedReason;pub use dc::BranchSusceptanceFormula;pub use diagnostics::EmitFamily;pub use error::Error;pub use error::Result;pub use format::routing::Detection;pub use format::routing::JSON_CLASSES;pub use format::routing::JsonClass;pub use format::routing::classify_json_bytes;pub use format::routing::classify_json_text;pub use format::routing::parse_distribution_format;pub use format::routing::parse_transmission_format;pub use format::EmitOptions;pub use format::PwdDisplay;pub use format::PwdSubstation;pub use format::SOURCE_FORMAT_NAMES;pub use format::TargetFormat;pub use format::emit;pub use format::emit_with_options;pub use format::parse;pub use format::parse_format_id;pub use format::parse_target_format;pub use gen_cost::GenCostPatch;pub use gen_cost::GenCostPolicyReport;pub use gen_cost::MissingGenCostPolicy;pub use gen_cost::parse_gen_cost_csv;pub use geo::Canvas;pub use geo::CoordinateSpace;pub use geo::CoordsKind;pub use geo::ElementKey;pub use geo::GeoApplyReport;pub use geo::GeoFeature;pub use geo::GeoGeometry;pub use geo::GeoLayer;pub use geo::GeoMeta;pub use geo::GeoParsed;pub use geo::GeoTarget;pub use geo::Location;pub use geo::apply_substation_points;pub use geo::to_geo_layer_from_aux_substations;pub use geo::to_geo_layer_from_pwd;pub use geo::to_lonlat_from_pwd_mercator;pub use hvdc::HvdcInjections;pub use hvdc::HvdcTerminalInjection;pub use hvdc::HvdcTerminalPowers;pub use hvdc::HvdcTreatment;pub use indexed::ConnectivityReport;pub use indexed::IndexCore;pub use indexed::IndexedNetwork;pub use islands::Island;pub use islands::IslandPartition;pub use islands::IslandReferencePolicy;pub use islands::IslandReferenceReport;pub use lcc::LccConverterState;pub use lcc::LccOperatingPoint;pub use merge::BusGroup;pub use merge::BusMerge;pub use merge::BusMergeRule;pub use merge::MergeSurvivor;pub use merge::MergedCharging;pub use merge::MergedFlows;pub use merge::PSSE_DEFAULT_ZERO_IMPEDANCE_THRESHOLD;pub use merge::RemovalReason;pub use merge::RemovedBranch;pub use merge::RemovedFlow;pub use merge::RemovedFlowMethod;pub use merge::RemovedFlows;pub use merge::RemovedSwitch;pub use merge::ZeroImpedanceRule;pub use network::AcDcConverterControlMode;pub use network::ActivePowerControl;pub use network::Area;pub use network::BalancedNetwork;pub use network::BoundaryLine;pub use network::BoundaryLineGeneration;pub use network::Branch;pub use network::BranchCharging;pub use network::BranchCurrentRatings;pub use network::BranchRatingSet;pub use network::BranchSolution;pub use network::Bus;pub use network::BusBreakerBus;pub use network::BusId;pub use network::BusType;pub use network::BusbarSection;pub use network::CalculatedBus;pub use network::CaseMetadata;pub use network::ComponentAlias;pub use network::ComponentMetadata;pub use network::ConnectivityNode;pub use network::CurveStyle;pub use network::DEFAULT_BASE_FREQUENCY;pub use network::DcBusbar;pub use network::DcConverterOperatingMode;pub use network::DcConverterUnit;pub use network::DcGround;pub use network::DcLine;pub use network::DcNode;pub use network::DcPolarity;pub use network::DcSeriesDevice;pub use network::DcSwitch;pub use network::DcSwitchKind;pub use network::DcTerminal;pub use network::DcTopologicalNode;pub use network::DetailedConnectivity;pub use network::DroopCurve;pub use network::DroopCurveSegment;pub use network::ExternalIdentifier;pub use network::Extras;pub use network::GenCaps;pub use network::GenCost;pub use network::Generator;pub use network::GeneratorEnergySource;pub use network::Hvdc;pub use network::HvdcConverter;pub use network::HvdcConverterKind;pub use network::HvdcConvertersMode;pub use network::Impedance;pub use network::ImpedanceCorrection;pub use network::ImpedanceCorrectionPoint;pub use network::ImpedanceCorrectionVariable;pub use network::InternalConnection;pub use network::Junction;pub use network::LineCommutatedConverter;pub use network::LineCommutatedConverterOperatingMode;pub use network::LineCommutatedConverterReactiveModel;pub use network::Load;pub use network::LoadVoltageModel;pub use network::LoadingLimits;pub use network::MinMaxReactiveLimits;pub use network::OmittedField;pub use network::OmittedFieldName;pub use network::OperationalLimitGroup;pub use network::ReactiveCapabilityCurve;pub use network::ReactiveCapabilityCurvePoint;pub use network::ReactiveLimits;pub use network::Shunt;pub use network::ShuntBlock;pub use network::SolverParams;pub use network::SourceFormat;pub use network::StaticVarCompensator;pub use network::StaticVarCompensatorRegulationMode;pub use network::Storage;pub use network::Subnetwork;pub use network::Substation;pub use network::Switch;pub use network::SwitchKind;pub use network::SwitchedShuntControl;pub use network::SwitchedShuntMode;pub use network::TapChanger;pub use network::TapChangerKind;pub use network::TapChangerRegulationMode;pub use network::TapChangerStep;pub use network::TemporaryLimit;pub use network::Terminal;pub use network::TerminalReference;pub use network::TieLine;pub use network::TopologyEndpoint;pub use network::TopologyKind;pub use network::TopologySwitch;pub use network::Transformer3W;pub use network::TransformerControl;pub use network::TransformerControlMode;pub use network::VoltageLevel;pub use network::VoltageSourceConverter;pub use network::Winding;pub use network::calc_series_admittance_of;pub use network::repair_values;
Modules§
- contingency
- PSS/E contingency description files (
.con). - dc
- Conventions shared by DC network models and matrix builders.
- diagnostics
- The codes this crate emits, and the registry gates over them.
- dynamic
- Loss-preserving support for PSS/E transient-stability DYR records.
- error
- format
- Parsing and emission for supported case formats, all meeting at
BalancedNetwork. - gen_
cost - geo
- Typed coordinate metadata for the balanced model, and the standalone
geographic document (
GeoLayer) that carries coordinates as a file of their own. - hvdc
- HVDC lines as fixed bus injections.
- indexed
IndexedNetwork: the dense-indexed analysis view over aBalancedNetwork.- islands
- Electrical islands and one reference bus per island.
- lcc
- The steady state of a line-commutated (LCC) two-terminal DC line at its AC terminal voltages.
- merge
- One explicit bus merge: closed switches and zero impedance branches.
- network
- Format neutral balanced network model.
Structs§
- BusSubset
- A bus cut and its source-to-result row maps.
- Diagnostic
- One coded user facing finding.
- Diagnostic
Code - Stable dotted identity of one diagnostic.
- Normalize
Options - Options for
BalancedNetwork::to_normalized_with_options. - Normalize
Report - What
BalancedNetwork::to_normalized_withchanged in the network before the pass itself, beside theNormalizedNetwork. - Normalize
Settings - Options for
BalancedNetwork::to_normalized_with: theNormalizeOptionsrepairs and the normalization choices added after them. Build one from its default or fromNormalizeOptionsand set the rest with thewith_*methods. - Normalize
Source Rows - Row provenance for one normalize pass: for each dense position in the
IndexedNetworkview of the normalized network, the row of the same element family in the source network.Nonemarks an element the pipeline synthesized, which has no source row. - Normalized
Network - Output of
BalancedNetwork::to_normalized_with_options. - Selector
- Which buses a
subsetkeeps: inclusive ranges over area, zone, base kV, and bus number, ANDed together. An unset (None) filter matches every bus, soSelector::defaultselects the whole network. - Zero
Impedance Reduction - What
reduce_zero_impedance_with_reportdid: the number of branches it removed and the merge’s diagnostics, or the error that left the network unchanged.
Enums§
- Angle
Difference Bounds - Which angle difference bounds an OPF or power flow preparation carries.
- Closed
Switch Policy - What normalization does with a closed switch that joins two buses.
- Diagnostic
Severity - Severity of one user facing finding.
- Error
Category - Coarse classification of an
Error, for callers that map onto their own taxonomy. Defined inpowerio-coreso every crate in the workspace projects onto the same five tokens. Coarse projection of an operation failure for bindings and exit statuses.
Constants§
- POWER_
MODELS_ ANGLE_ BOUND_ PAD - Default branch angle difference bound used by PowerModels parse time repair.
- VERSION
- The powerio crate version, for provenance fields written by downstream crates whose own version can drift from the core’s.
Functions§
- correct_
angle_ difference_ bounds - Correct one branch angle difference interval using the same ±60 degree
rule as PowerModels’
correct_voltage_angle_differences!. - stated_
angle_ difference_ bounds - One branch angle difference interval as the source states it, for a consumer that applies no pad. Inputs and outputs are radians.