Skip to content

Expose JSON Config Generators as scripts#312

Open
hayekr wants to merge 12 commits intoRnDfrom
311-make-the-json-config-generators-script-available
Open

Expose JSON Config Generators as scripts#312
hayekr wants to merge 12 commits intoRnDfrom
311-make-the-json-config-generators-script-available

Conversation

@hayekr
Copy link
Collaborator

@hayekr hayekr commented Mar 3, 2026

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 a main function 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:

  • Moved the random topology generator from utils/json_config_generators/config_generator_random.py to sequence/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.

@hayekr hayekr requested a review from caitaozhan as a code owner March 3, 2026 03:05
Copilot AI review requested due to automatic review settings March 3, 2026 03:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a main() entry point.
  • Updated imports (notably in config_generator_tree.py and config_generator_random.py) to use package-relative imports.
  • Registered console scripts (e.g., generate-linear, generate-mesh, etc.) in pyproject.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_branches now depends on the parsed args, but this generator references args.parallel inside add_branches even though main() only uses add_default_args(parser) (which doesn't define --parallel). This will crash with AttributeError during generation unless the missing CLI options are added (or the args.parallel logic/docstring is removed or refactored).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hayekr hayekr changed the title 311 make the json config generators script available Expose JSON Config Generators as scripts Mar 4, 2026
@hayekr hayekr requested a review from caitaozhan March 5, 2026 02:19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure we can leave draw_topo out and move it when it's refactored.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move draw_topo.py to what place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants