Skip to content

Add PSLF EPC reader + Improve coverage of PW vintages#125

Merged
samtalki merged 10 commits into
mainfrom
agent/pslf-epc-reader-core
Jun 17, 2026
Merged

Add PSLF EPC reader + Improve coverage of PW vintages#125
samtalki merged 10 commits into
mainfrom
agent/pslf-epc-reader-core

Conversation

@samtalki

@samtalki samtalki commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds read support for GE PSLF .epc power flow cases.

  • Adds a PSLF parser that maps the static power flow core into Network.
  • Wires .epc detection and pslf/epc aliases through parse_file, parse_str, CLI --from, Rust re-exports, and Python type stubs.
  • Keeps PSLF read only by rejecting it as a conversion target.
  • Adds integration tests for aliases, uppercase .EPC inference, and the read only target guard.

Improve coverage of .pwb and .pwd vintages based on UIUC corpus

Validation

  • cargo fmt --all --check
  • cargo clippy --all-targets
  • cargo test
  • cargo test -p powerio --test pslf

@samtalki samtalki changed the title Add PSLF EPC reader Add PSLF EPC reader + Improve coverage of .pwb vintages Jun 16, 2026
@samtalki samtalki changed the title Add PSLF EPC reader + Improve coverage of .pwb vintages Add PSLF EPC reader + Improve coverage of PW vintages Jun 16, 2026
@samtalki samtalki requested a review from Copilot June 16, 2026 21:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds read support for GE PSLF .epc cases and expands PowerWorld binary/display coverage, wiring the new format through the Rust hub, CLI, Python stubs, and C ABI docs while keeping PSLF read-only.

Changes:

  • Implement PSLF .epc reader that maps core power-flow data into Network, retains source text, and emits read warnings for unsupported sections.
  • Add PSLF format inference/aliases through parse_file/parse_str, Rust re-exports, CLI --from, and Python type stubs; explicitly reject PSLF as a conversion target.
  • Broaden PowerWorld .pwb vintage support (additional header constants, resilience improvements) and make .pwd parsing return metadata even when the substation table is absent; add/extend tests and docs accordingly.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Document PSLF EPC as a supported (read-only) input and update format table/examples.
python/powerio/_powerio.pyi Add Pslf to the source_format literal typing.
python/powerio/init.pyi Add Pslf to the Network.source_format literal typing.
python/powerio/init.py Update Python package docstring and docs for PSLF read warnings / convert behavior.
powerio/tests/pslf.rs Add integration tests for PSLF aliases, .EPC inference, and read-only target guard.
powerio/tests/powerworld_pwd.rs Update tests to match new .pwd behavior when no substation identity table exists.
powerio/tests/powerworld_pwb.rs Expand .pwb coverage tests (more header constants, truncation safety, corpus-gated parity checks).
powerio/src/network.rs Add SourceFormat::Pslf.
powerio/src/lib.rs Re-export PSLF parser and update crate-level docs to mention read-only PSLF EPC.
powerio/src/format/pslf.rs New PSLF EPC reader implementation mapping EPC sections into Network + warnings/extras retention.
powerio/src/format/powerworld/pwd.rs Change .pwd parsing to return metadata with empty substations when identity table is absent.
powerio/src/format/powerworld/pwb.rs Expand .pwb vintage support and robustness (header constants, table search heuristics, truncation safety).
powerio/src/format/mod.rs Wire PSLF into the format hub: aliases, .epc inference, and read-only handling (not in TargetFormat).
powerio/README.md Update crate README to mention PSLF .epc and .pwb as read-only inputs.
powerio-py/src/lib.rs Update Python binding docstring for parse_str to include pslf/epc.
powerio-matrix/src/lib.rs Re-export parse_pslf from the matrix crate’s umbrella re-exports.
powerio-cli/src/main.rs Add CLI --from pslf/epc and reject PSLF as a convert --to target.
powerio-capi/src/lib.rs Update C ABI documentation comments to include pslf/epc as accepted inputs.
powerio-capi/include/powerio.h Update header docs to include pslf/epc as accepted inputs.
docs/powerworld.md Update PowerWorld vintage documentation and coverage matrix; note new behaviors (including header 554).
docs/format-fidelity.md Document PSLF shunt per-unit interpretation and PSLF read-only fidelity notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread powerio/src/format/powerworld/pwb.rs Outdated
Comment thread powerio/src/format/powerworld/pwb.rs
Comment thread powerio/src/format/pslf.rs
Comment thread docs/powerworld.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Comment thread powerio/src/format/powerworld/pwb.rs
Comment thread powerio/src/format/pslf.rs Outdated
Comment thread powerio-capi/src/lib.rs Outdated
Comment thread powerio-capi/include/powerio.h Outdated
Comment thread docs/powerworld.md Outdated
@samtalki samtalki marked this pull request as ready for review June 17, 2026 00:16
@samtalki samtalki merged commit 00d61c8 into main Jun 17, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants