Skip to main content

Crate powerio_pkg

Crate powerio_pkg 

Source
Expand description

.pio.json package metadata and model payloads.

PowerIO keeps two static network model families as separate types:

A NetworkPackage stores one payload with an explicit ModelKind, producer and origin metadata, source maps, diagnostics, validation results, and lowering history. Optional operating points replay independent states; optional study commits apply cumulative edits. GOC3 packages use operating points for the source time series: the payload holds one static interval, and NetworkPackage::materialize_operating_point derives another static package from a selected period. It serializes to .pio.json. See docs/src/compiler-ir.md for the architecture and docs/src/pio-json-schema.md for the field reference.

The package always carries NetworkPackage::model_kind explicitly; a reader must never infer whether the payload is balanced or multiconductor from which field is present. NetworkPackage::kind_is_consistent asserts the explicit kind agrees with the payload variant.

use powerio_pkg::{NetworkPackage, ModelKind};

let net = powerio::BalancedNetwork::in_memory("demo", 100.0, vec![], vec![]);
let pkg = NetworkPackage::from_balanced(net);
assert_eq!(pkg.model_kind(), ModelKind::Balanced);
assert!(pkg.kind_is_consistent());
let json = pkg.to_json_pretty().unwrap();
let back = NetworkPackage::from_json(&json).unwrap();
assert_eq!(back.model_kind(), ModelKind::Balanced);

Re-exports§

pub use diagnostics::DiagnosticCode;
pub use diagnostics::DiagnosticSeverity;
pub use diagnostics::DiagnosticStage;
pub use diagnostics::StructuredDiagnostic;
pub use geo::apply_dist_geo_layer;
pub use geo::dist_geo_layer;
pub use lowering::LoweringRecord;
pub use lowering::MulticonductorToBalancedError;
pub use lowering::MulticonductorToBalancedLowering;
pub use lowering::MulticonductorToBalancedOptions;
pub use lowering::MulticonductorToBalancedReadiness;
pub use lowering::SequenceTransformConvention;
pub use lowering::check_multiconductor_to_balanced_lowering;
pub use lowering::lower_multiconductor_to_balanced;
pub use model::ModelKind;
pub use model::ModelPayload;
pub use operating::ElementRef;
pub use operating::ElementUpdate;
pub use operating::OperatingPoint;
pub use operating::OperatingPointSeries;
pub use operating::TimeAxis;
pub use package::DerivedMetadata;
pub use package::NetworkPackage;
pub use package::NormalizedSolverTableMetadata;
pub use package::NormalizedSolverTableRowCounts;
pub use package::NormalizedSolverTableSourceRows;
pub use package::PIO_PACKAGE_SCHEMA_URL;
pub use package::PIO_PACKAGE_SCHEMA_VERSION;
pub use package::PIO_PAYLOAD_BALANCED_SCHEMA_URL;
pub use package::PIO_PAYLOAD_BALANCED_SCHEMA_VERSION;
pub use package::PIO_PAYLOAD_MULTICONDUCTOR_SCHEMA_URL;
pub use package::PIO_PAYLOAD_MULTICONDUCTOR_SCHEMA_VERSION;
pub use package::READ_GRIDFM_FIDELITY_WARNING;
pub use package::READ_TRANSMISSION_PARSE_WARNING;
pub use package::ensure_payload_uids;
pub use provenance::Confidence;
pub use provenance::MappingKind;
pub use provenance::Origin;
pub use provenance::Producer;
pub use provenance::SourceDescriptor;
pub use provenance::SourceMapEntry;
pub use provenance::SourceRef;
pub use study::StudyBlock;
pub use study::StudyCommit;
pub use study::StudyEdit;
pub use summary::ObjectSummary;
pub use summary::ObjectTopology;
pub use summary::ObjectUnits;
pub use validation::ValidationCounts;
pub use validation::ValidationPass;
pub use validation::ValidationStatus;
pub use validation::ValidationSummary;

Modules§

diagnostics
Structured diagnostics.
geo
Geographic layer glue for the multiconductor model.
lowering
Lowering records and preflight checks.
model
The model kind and the single typed IR payload.
operating
Replayable operating point overlays for .pio.json packages.
package
The .pio.json root object.
provenance
Producer, origin, source descriptors, and source maps.
study
Cumulative study edits for .pio.json packages.
summary
A human-oriented summary of the payload.
validation
The package-level validation summary.