Skip to content

Rename pecos.guppy module to pecos.guppy_gen - #413

Draft
ciaranra wants to merge 5 commits into
devfrom
guppy-gen-rename
Draft

Rename pecos.guppy module to pecos.guppy_gen#413
ciaranra wants to merge 5 commits into
devfrom
guppy-gen-rename

Conversation

@ciaranra

@ciaranra ciaranra commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Renames the pecos.guppy module (QEC circuit generators that emit Guppy source: make_surface_code, color-code and transversal-gate generators, variant_scoped) to pecos.guppy_gen.

Motivation:

  • from pecos import guppy and from guppylang import guppy could silently shadow each other in a file using both, since PECOS programs commonly import the guppy decorator.
  • The new name states what the module does (generate Guppy code) and removes the near-collision with the pecos.Guppy program wrapper used by sim().

Changes

  • git mv python/quantum-pecos/src/pecos/guppy -> pecos/guppy_gen (history preserved)
  • All references updated: source, tests, ruff.toml per-file ignores, docs, and example notebooks
  • Top-level pecos/__init__.py import and __all__ updated

Not touched: the SLR codegen target string "guppy" (generate(prog, "guppy")), pecos.slr.ast.codegen.guppy, pecos._compilation.guppy, and the tests/guppy/ directory name (its contents cover Guppy/HUGR compilation broadly, not just this module).

A deprecated pecos.guppy alias package keeps the old path working with a DeprecationWarning (mirroring the pecos.tools -> pecos.analysis precedent), since the old path shipped in the published 0.9.0.dev2 release. Submodule aliases are registered in sys.modules so import pecos.guppy.surface and unpickling of objects serialized before the rename both resolve; a lazy __getattr__ hook covers pecos.guppy attribute access. Regression tests cover all three paths and were mutation-tested against each guard.

Testing

  • pytest tests/guppy tests/qec tests/pecos/test_selene_sim_parity.py: 1635 passed, 13 skipped (pre-existing optional-dependency skips), 1 xfailed
  • just lint over the full repository: clean
  • Verified pecos.guppy_gen imports and old pecos.guppy is gone

@ciaranra ciaranra added the enhancement New feature or request label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant