feat: adopt powerio 0.2.2 and expose the PowerWorld .pwd display reader#45
Merged
Merged
Conversation
powerio 0.2.2 moved the four folder/Parquet tools (read_pypsa_csv_folder, write_pypsa_csv_folder, read_gridfm, write_gridfm) into the canonical powerio.mcp.server (powerio #119), so powerio_mcp.py drops its local overlay for them and re-exports all twelve canonical tools verbatim. The one remaining overlay is read_display_file, wrapping the new .pwd display API from powerio #120 (parse_display_file) until the canonical server exposes a display tool of its own. It returns the one-line diagram canvas and each substation's display coordinates. - bump the powerio pin to >=0.2.2 - delete the 4-tool overlay; add those four names to the re-export - add read_display_file + tests against a vendored ACTIVSg200.pwd fixture (un-ignored in .gitignore so it ships) - the 0.2.2 AUX/PSS/E parsing and PTDF/LODF fixes reach the bridges and compute_matrix automatically, no code change Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- guard display.kind != "powerworld" so a future powerio display kind raises a clean ValueError instead of an opaque AttributeError (the pin is a >=0.2.2 floor and powerio #120's scope mentions PSS/E display formats) - fix the docstring return types: canvas dims and stamp are ints, not float/str - importorskip powerio with minversion="0.2.2" so the suite skips, rather than errors, on a stale powerio that predates the canonical tools - add a corrupt-.pwd regression test (PowerIOParseError maps to ValueError) - narrow the .gitignore negation to the exact fixture, not *.pwd, so a private .pwd dropped in tests/data/powerworld/ stays ignored Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
@qian-harvard ready for your review |
qian-harvard
approved these changes
Jun 15, 2026
qian-harvard
left a comment
Contributor
There was a problem hiding this comment.
Reviewed — LGTM. This is exactly the "pure re-export + thin overlay" endgame we'd converged on.
- The four folder/Parquet tools now come from
powerio.mcp.server(upstreamed in powerio #119), and the previously-needed_load/_summaryprivate imports are correctly dropped — no dead imports or dangling refs. read_display_filemapsPowerIOError/FileNotFoundError/OSError→ValueError(the server's one-error-shape convention) and guardsdisplay.kind != "powerworld"before touchingdisplay.data, avoiding an opaqueAttributeErroron any future display kind.- Pin bump to
>=0.2.2is consistent with depending on the upstreamed tools. - Error-mapping + decode tests cover the new overlay; the folder/Parquet tests pass unchanged against the re-exported tools, so the overlay deletion is behavior-preserving.
CI green on py3.10/py3.12.
🤖 Reviewed with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adopt powerio 0.2.2 and finish wiring up the conversion server.
>=0.2.2.powerio.mcp.server, sopowerio_mcp.pydrops its local overlay for them and re-exports all twelve canonical tools verbatim — the "canonical upstream, thin copy here" shape we've been converging on.read_display_file, a thin overlay over the new.pwddisplay API from #120 (parse_display_file). It returns the one-line diagram's canvas and each substation's display coordinates, so a client can lay out a network without PowerWorld installed.The one remaining overlay
powerio_mcp.pyis now a pure re-export except forread_display_file. powerio 0.2.2 ships.pwdparsing as a Python API, but the canonical MCP server doesn't expose a display tool yet. Once it does upstream, this overlay deletes and the module becomes a pure re-export — the same lifecycle the folder/Parquet tools just finished. Glad to send that display-tool PR to powerio next if it's wanted.Inherited for free
The 0.2.2 AUX name-keyed parsing, PSS/E v34 headers, and PTDF/LODF indefinite-Laplacian fallback reach the existing pandapower/PyPSA/Egret/ANDES bridges and the re-exported
compute_matrixwith no code change.Tests
read_display_filedecodes a vendoredACTIVSg200.pwdfixture (canvas + 111 substations) and maps a missing file to a clean error.PowerMCP's own version is unchanged here; a release bump can follow separately.
🤖 Generated with Claude Code