powerio-matrix/src/synth/ has generate_tree, generate_lattice, and generate_pegase_like, all (spec: &SynthSpec) -> Network with SynthSpec { topology, n, r_over_x, mean_x, seed } (defaults n=64, r_over_x=0.1, mean_x=0.05, fixed seed). Today they are reachable only through the powerio gen CLI subcommand; nothing in powerio-py/src/lib.rs wraps them.
Plan:
- One
#[pyfunction] generate_case(topology: &str, n: usize, r_over_x: f64, mean_x: f64, seed: u64) -> PyResult<PyCase> with a string→Topology parse following the existing parse_scheme/parse_convention helpers; defaults matching SynthSpec::default(). powerio-py already depends on powerio-matrix, so no crate wiring.
- Python wrapper
powerio.generate_case(topology="tree", n=64, ...) -> Network plus __all__ and stub updates.
- A
generate_case MCP tool in python/powerio/mcp/server.py returning {"json", "summary"} so synthetic cases enter the same JSON transport pipeline as parsed ones.
Deterministic seeds make this test friendly: same seed, same json. Tests: each topology yields the expected bus count (lattice rounds n up to a perfect square), bus 1 is REF, and the json round trips through from_json.
🤖 Generated with Claude Code
powerio-matrix/src/synth/hasgenerate_tree,generate_lattice, andgenerate_pegase_like, all(spec: &SynthSpec) -> NetworkwithSynthSpec { topology, n, r_over_x, mean_x, seed }(defaults n=64, r_over_x=0.1, mean_x=0.05, fixed seed). Today they are reachable only through thepowerio genCLI subcommand; nothing inpowerio-py/src/lib.rswraps them.Plan:
#[pyfunction] generate_case(topology: &str, n: usize, r_over_x: f64, mean_x: f64, seed: u64) -> PyResult<PyCase>with a string→Topologyparse following the existingparse_scheme/parse_conventionhelpers; defaults matchingSynthSpec::default().powerio-pyalready depends onpowerio-matrix, so no crate wiring.powerio.generate_case(topology="tree", n=64, ...) -> Networkplus__all__and stub updates.generate_caseMCP tool inpython/powerio/mcp/server.pyreturning{"json", "summary"}so synthetic cases enter the same JSON transport pipeline as parsed ones.Deterministic seeds make this test friendly: same seed, same json. Tests: each topology yields the expected bus count (lattice rounds n up to a perfect square), bus 1 is REF, and the json round trips through
from_json.🤖 Generated with Claude Code