Skip to content

Expose the synth generators through powerio-py and the MCP server #86

@samtalki

Description

@samtalki

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions