-
Notifications
You must be signed in to change notification settings - Fork 37
feat: Add configuration management system #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aries043
wants to merge
14
commits into
Evolutionary-Intelligence:main
Choose a base branch
from
aries043:refactor-optimizer-selection-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add configuration management system #471
aries043
wants to merge
14
commits into
Evolutionary-Intelligence:main
from
aries043:refactor-optimizer-selection-2
Conversation
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
…stry - Replace 80+ line if-elif chain with centralized OPTIMIZER_CONFIGS dictionary - Add type hints and proper error handling - Improve code maintainability and readability - Add comprehensive GitHub Actions testing workflow - Include argument validation and better error messages Fixes: Long if-elif chain making code hard to maintain
- Add ExperimentConfig dataclass for centralized settings - Support JSON and YAML configuration files - Add --config and --save-config-template CLI options - Replace hardcoded values with configurable parameters - Add separate GitHub Actions workflows for each improvement - Improve code maintainability and flexibility
- Remove trailing whitespace and blank line whitespace (W291, W293) - Remove unused variable config_with_comments (F841) - Add newline at end of file (W292) - Remove docstring comments as requested - Clean up code formatting for better maintainability
- Remove all explanatory comments as requested - Remove docstrings from functions and classes - Keep only essential file header docstring - Clean up code to focus on functionality only
- Remove remaining blank line whitespace (W293) - Add proper newline at end of file (W292) - Ensure clean code formatting
- Remove blank line whitespace (W293) - Add proper newline at end of file (W292) - Clean code formatting complete
- Remove blank line whitespace (W293) - Add proper newline at end of file (W292) - Clean code formatting complete
@aries043 Thanks very much again for your wonderful configuration management system. I will integrate it after I check it. As I am busy, this integration may be relatively slow (sorry). |
That's fine! Thank you for carefully considering my suggestions. |
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.
Summary
This PR introduces a comprehensive configuration management system to replace hardcoded values throughout the benchmarking script. The change enables flexible experiment customization through external configuration files while maintaining full backward compatibility.
The previous refactoring is verified in test-refactorizing-1.yml, and the problem is verified in test-refactorizing-2.yml.
Problem
The current benchmarking script has several configuration management issues:
Solution
1. Centralized Configuration Class
Introduced
ExperimentConfig
dataclass to consolidate all configurable parameters:2. Configuration File Support
Added support for both JSON and YAML configuration files:
3. Template Generation
Added configuration template generation for easy customization:
4. Enhanced CLI Interface
Extended command-line interface with configuration options:
--config
: Specify custom configuration file--save-config-template
: Generate configuration templateKey Benefits
--save-config-template
Backward Compatibility
Configuration Options
max_function_evaluations_multiplier
max_runtime_hours
fitness_threshold
saving_fitness
boundary_range
sigma_value
random_seed
verbose_level
results_folder
Example Configuration File
Testing
Enhanced GitHub Actions workflow tests:
Files Changed
tutorials/benchmarking_lsbbo_2.py
- Added comprehensive configuration management.github/workflows/test-refactoring-2.yml
- Configuration-focused test suiteUsage Examples
Future Enhancements
This configuration system enables future improvements:
However, this PR focuses on establishing the core configuration infrastructure while maintaining simplicity and backward compatibility.
Testing Instructions: