Conversation
There was a problem hiding this comment.
Pull request overview
This PR relocates JSON network configuration generator scripts into sequence/config_generators/ and exposes them as installable CLI commands via pyproject.toml, making topology config generation accessible through generate-* entry points.
Changes:
- Moved/added multiple topology config generators under
sequence/config_generators/and refactored them to provide amain()entry point. - Updated imports (notably in
config_generator_tree.pyandconfig_generator_random.py) to use package-relative imports. - Registered console scripts (e.g.,
generate-linear,generate-mesh, etc.) inpyproject.toml.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/json_config_generators/config_generator_star.py | Removed legacy star generator script from utils location. |
| utils/json_config_generators/config_generator_ring.py | Removed legacy ring generator script from utils location. |
| utils/json_config_generators/config_generator_mesh.py | Removed legacy mesh generator script from utils location. |
| utils/json_config_generators/config_generator_line.py | Removed legacy line generator script from utils location. |
| utils/json_config_generators/config_generator_caveman.py | Removed legacy caveman generator script from utils location. |
| utils/json_config_generators/config_generator_as_memo_num.py | Removed legacy AS/memo generator script from utils location. |
| sequence/config_generators/config_generator_tree.py | Refactored tree generator into a main() and adjusted recursion signature. |
| sequence/config_generators/config_generator_star.py | Added star generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_ring.py | Added ring generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_mesh.py | Added mesh generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_line.py | Added line generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_caveman.py | Added caveman generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_as_memo_num.py | Added AS/memo generator under package with main() and relative imports. |
| sequence/config_generators/config_generator_random.py | Updated random generator to use package-relative imports. |
| sequence/config_generators/init.py | Package marker for config generators. |
| pyproject.toml | Added [project.scripts] registrations for generator CLIs. |
Comments suppressed due to low confidence (1)
sequence/config_generators/config_generator_tree.py:40
add_branchesnow depends on the parsedargs, but this generator referencesargs.parallelinsideadd_brancheseven thoughmain()only usesadd_default_args(parser)(which doesn't define--parallel). This will crash withAttributeErrorduring generation unless the missing CLI options are added (or theargs.parallellogic/docstring is removed or refactored).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
config_generators is a top-level module. Shall we move it under sequence.utils?
For the utils folder outside of sequence, only the draw_topo.py is useful. We could move draw_topo.py as well, and then delete the utils folder outside of sequence.
There was a problem hiding this comment.
I figure we can leave draw_topo out and move it when it's refactored.
There was a problem hiding this comment.
move draw_topo.py to what place?
This pull request introduces several new configuration generator scripts for different network topologies and integrates them into the project as command-line tools. These generators automate the creation of JSON config files for various quantum network layouts, improving usability and extensibility. Additionally, the pull request refactors and organizes the codebase for better maintainability.
New configuration generators and CLI integration:
Added new scripts for generating network configuration files in different topologies: Internet Autonomous System (
config_generator_as_memo_num.py), Caveman (config_generator_caveman.py), Linear (config_generator_line.py), Mesh (config_generator_mesh.py), Random (config_generator_random.py), Ring (config_generator_ring.py), and Star (config_generator_star.py). Each script provides amainfunction and command-line interface for generating JSON configs. [1] [2] [3] [4] [5] [6]Registered all new configuration generators as project scripts in
pyproject.toml, making them accessible as CLI commands (e.g.,generate-linear,generate-mesh, etc.).Code organization and refactoring:
utils/json_config_generators/config_generator_random.pytosequence/config_generators/config_generator_random.py, and updated imports to use relative paths for consistency.These changes make it much easier to generate and customize network configurations for simulations, and improve the structure of the codebase for future development.