feat: expose the synth generators through powerio-py and the MCP server#89
Draft
samtalki wants to merge 1 commit into
Draft
feat: expose the synth generators through powerio-py and the MCP server#89samtalki wants to merge 1 commit into
samtalki wants to merge 1 commit into
Conversation
One generate_case(topology, n, r_over_x, mean_x, seed) pyfunction dispatching
through synth::generate, with a parse_topology helper following parse_scheme.
Python wrapper powerio.generate_case(...) -> Network with stub updates, and a
generate_case MCP tool returning {"json", "summary"} so synthetic cases enter
the same transport pipeline as parsed ones. Defaults match SynthSpec::default
and identical seeds generate identical cases.
Closes #86.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
afd30bf to
bd8b261
Compare
Member
Author
|
Parked as draft for the 0.1.3 cycle: the synth generators stay an internal test tool for now. Whether and how they become public API (own crate, naming, scope) is open for discussion in the RFC issue; this PR's Python/MCP surface follows that decision. |
This was referenced Jun 10, 2026
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.
Closes #86.
powerio-matrix's synth generators (generate_tree/generate_lattice/generate_pegase_like) were reachable only through thepowerio genCLI subcommand. This adds:#[pyfunction] generate_case(topology=None, n=64, r_over_x=0.1, mean_x=0.05, seed=0xC0FFEE)dispatching throughsynth::generate, with aparse_topologyhelper following the existingparse_scheme/parse_conventionpattern (tree,lattice/lattice2d,pegase/pegase-like, case and separator insensitive).powerio.generate_case(...) -> Networkwrapper,__all__, and stub updates.generate_caseMCP tool returning{"json", "summary"}, so synthetic cases flow into the same JSON transport pipeline as parsed ones.Tests: tree defaults (n-1 branches, radial, bus 1 REF, no gens/loads/shunts), lattice rounding to the next perfect square, pegase-like meshing, seed determinism, JSON round trip, matrix builders on a generated case, unknown topology error, and the MCP tool.
cargo test/clippy --all-targets/clippy -p powerio-py --features extension-module,gridfm -D warnings/fmt --checkandpytest python/tests(76 passed, 2 skipped) are green.Independent of #88; no version bump.
🤖 Generated with Claude Code