Merged
Conversation
- Moved all argument registration scripts from arg_scripts/ to fusion/cli/args/ - config_args.py → run_sim_args.py - parse_args.py → main_parser.py - setup_config.py → config_setup.py - Added __init__.py to cli/ and cli/args/ with docstrings and import structure - Deleted legacy arg_scripts/ directory - Established CLI entrypoint structure for run_sim.py, run_train.py, run_gui.py (empty or stubbed for now) - Ready for Phase 1 test coverage: CLI parsing, config resolution
- Replaced legacy flat argument parsing with subcommand-based parser - Implemented register_run_sim_args to handle all COMMAND_LINE_PARAMS under 'run_sim' - Stubbed setup_config_from_cli to return vars(args) for now - Verified that parsed CLI args pass through to config successfully - Commented out unimplemented CLI modules in cli/args/__init__.py - Validated CLI end-to-end via: python -m fusion.cli.run_sim run_sim --erlang_start 100 --run_id test123
- Moved NetworkSimulator into fusion/sim/network_simulator.py - Updated imports (e.g., src.engine → fusion.core.engine) - Updated CLI run_sim.py to use new run_simulation entrypoint
- Connected build_parser → setup_config → run_simulation - Added print to confirm parsed config - Early test run parsing support
- Integrated argparse-based command parsing into fusion.cli.run_sim - Fixed config loading for INI files using setup_config_from_cli() - Added support for relative and user-specified config paths - Ensured proper simulation launch via fusion.sim.run_simulation() - Verified successful end-to-end execution with parsed config
- Integrated multiprocessing.Event() to support graceful shutdowns - Updated fusion/cli/run_sim.py to create and pass stop_flag to simulation runner - Ensures clean process termination and future compatibility with GUI/interactive use
- Updated `create_input()` and `save_input()` in setup_helpers.py to resolve all paths via PROJECT_ROOT - Prevented accidental writes to cli/data by enforcing top-level FUSION/data/ - Ensured proper file flushing and syncing for input JSON reliability - Added fallback logic to find project root via .git or run_sim.py
- Consolidated training CLI through run_train.py to support both RL and ML pipelines. - Introduced ConfigManager in fusion/cli/config_setup.py for centralized configuration loading and parsing. - Added modular argument parsing functions (e.g., add_run_sim_args, add_routing_args, etc.) in the CLI args modules. - Stubbed train_pipeline.py (RL) and ml_pipeline.py (ML) to verify proper dispatch based on agent type. - Ensured multi-threaded config support (e.g., s1, s2 sections) is maintained across pipelines.
- Replaced legacy CLI logic in run_gui.py with standardized main_parser and ConfigManager usage. - Added gui_args.py with support for --config_path and --run_id flags. - Stubbed launch_gui() in fusion/gui/runner.py for future GUI logic integration. - Verified end-to-end CLI parsing, config validation, and stub dispatch.
3c119bb to
3fc2c0a
Compare
Collaborator
Author
|
This Unit Test passes locally, interesting. Any ideas @bozo-bud ? |
Contributor
|
I think test get start time has an issue where the times will sometimes not match. I haven't been able to replicate it or get it to happen consistently though. |
Collaborator
Author
|
This could either be a fluke or the error that happens on Unity at times. If a user submits hundreds of jobs sometimes they write over each other... Maybe there is a start time consistency issue |
The RL pipeline is not working properly with the new refactor including: - Input/Output results - Config files
…/scaffold # Conflicts: # fusion/helper_scripts/sim_helpers.py
Moved files to more scalable directories. Changed naming conventions to be more consistent and readable. Broke up multi-class files into multiple single class files. Added skeleton files for future refactor.
… correlate to new run function.
arashr88
approved these changes
Aug 12, 2025
Refactor/rl cli
Refactor/sim-core
Refactor/helpers
…/scaffold_gui # Conflicts: # fusion/sim/utils.py
Refactor/scaffold gui
Collaborator
Author
|
The failure is on the pull request target and passes on this PR. Will ignore for now. |
- Prevent duplicate link processing in _get_link_usage_summary - Fix division by zero in bit_rate_blocking_prob calculation - Prevent duplicate modulation statistics processing - Add safeguards for block_reasons_dict normalization - Improve debug logging and code formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Only reset environment if trials are not yet completed - Prevents unnecessary resets after all trials are finished 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Move all imports to top level to resolve import-outside-toplevel warnings - Remove unused 'is_testing' parameter from run_rl_simulation function - Extract helper functions to reduce statement count in _run_single_case - Resolve all reimport and unused-import warnings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove run_gui.py, run_ml_sim.py, run_rl_sim.py, and run_sim.py - These scripts have been replaced by the new CLI structure - Functionality has been migrated to fusion module 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
ryanmccann1024
added a commit
that referenced
this pull request
Aug 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This pull request completes a comprehensive refactor of the FUSION project, addressing code quality, architectural improvements, and bug fixes. The changes build upon the previous CLI architectural refactor and focus on stabilizing the codebase while removing deprecated functionality.
Key Changes:
🔧 Code Quality & Bug Fixes
🧹 Code Cleanup & Maintenance
run_gui.py,run_ml_sim.py,run_rl_sim.py, andrun_sim.pyas these have been fully replaced by the new CLI structure🏗️ Architectural Improvements
Fixes: Issues with code quality violations and deprecated script usage
🧐 Type of Change
💥 Impact of Breaking Change
This PR contains moderate breaking changes related to the removal of deprecated scripts.
What will stop working?
run_gui.py,run_ml_sim.py,run_rl_sim.py,run_sim.py) will no longer workMigration Path for Users:
python -m fusion.cli run_siminstead ofpython run_sim.pypython -m fusion.cli traininstead ofpython run_rl_sim.pypython -m fusion.cli guiinstead ofpython run_gui.pyAll core functionality remains available through the unified CLI interface.
🧪 How Has This Been Tested?
Code Quality Validation
tests/run_comparison.pyhave been resolvedFunctional Testing
Integration Testing
Test Configuration:
📈 Performance Impact
🔍 Code Review Focus Areas
✅ Final Checklist
📋 Additional Notes
This PR represents the completion of the architectural refactor phase, focusing on code quality and stability. The removal of deprecated scripts finalizes the transition to the unified CLI architecture, providing a cleaner and more maintainable codebase for future development.
The metrics fixes address several edge cases that could cause runtime errors in production scenarios, particularly around division by zero and duplicate data processing. The RL workflow improvements ensure more robust training procedures.