Merged
Conversation
…s with RuntimeFlags struct
…cture, design principles, available optimizers, and usage instructions
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.
This pull request introduces several improvements to the EGO optimizer codebase, focusing on enhancing configurability, code clarity, and maintainability. The most significant change is the introduction of a new
RuntimeFlagsstruct, which centralizes runtime behavior configuration and replaces scattered environment variable checks. Additionally, several modules now have improved documentation, and there are refactorings to ensure state fields are accessed consistently through their logical groupings.Major improvements:
1. Configurability and Runtime Behavior
RuntimeFlagsstruct inegor_config.rs, allowing programmatic control over runtime behaviors (such as logging, use of specific optimization features, and data recording) that were previously controlled via environment variables. The struct provides builder-style methods and maintains backward compatibility by reading environment variables in its default implementation.runtime_flagsas a field toValidEgorConfigand provided methods inEgorConfigto configure these flags, either via a closure or by direct assignment. [1] [2]2. Refactoring State Access
egor.rsandegor_solver.rsto access fields such asdata,theta_inits,clusterings, andx_failthrough the appropriate sub-structs (e.g.,state.surrogateorstate.doe) instead of directly onstate. This makes the codebase more modular and easier to maintain. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]3. Documentation and Code Clarity
optimizers/mod.rs,optimizers/optimizer.rs, andsolver/egor_config.rs, explaining architecture, available features, and usage examples. [1] [2] [3]4. Consistent Use of Runtime Flags
runtime_flagsfield, ensuring all runtime behavior is controlled in a centralized and testable manner. [1] [2] [3]These changes collectively improve the flexibility, maintainability, and clarity of the EGO optimizer codebase, making it easier to configure and extend in the future.