Skip to main content

Module pipeline

Module pipeline 

Source
Expand description

Orchestrates a single case → output directory.

Given a parsed BalancedNetwork, calculates the requested matrix family, writes .mtx files, and emits a meta.json sidecar describing what was produced. Used by both the batch CLI subcommand and the TUI’s batch export screen.

Structs§

Pipeline
PipelineOutputs

Enums§

MatrixKind
RhsKind
How to populate the RHS vector(s) emitted alongside each matrix.

Functions§

calc_matrix
Calculate the square matrix for one MatrixKind from an indexed network. This is the dispatch shared by the Pipeline, the verify CLI command, and the TUI inspect screen, so the YbusB = -Im(Y_bus) sign lives in one place.
calc_matrix_stats_for_kind
calc_zero_impedance_skips_for_kind
sanitize_stem
Reduces a network name to a single safe filename stem. The name comes from input content, so an unsanitized value like ../../etc/x or /abs/x used in out_dir.join(...) would write outside out_dir. Keeps ASCII alphanumerics, -, _, and .; every other character (path separators included) becomes _. Leading dots are stripped so the result is never ., .., or a hidden file; trailing dots are trimmed and Windows reserved device names get a leading _, both invalid as Windows filenames; the length is capped at 120 bytes; and an empty result falls back to case.
select_zero_impedance_rule_for_kind