[Pyomo.DoE] Add simultaneous design of multiple experiments#3866
[Pyomo.DoE] Add simultaneous design of multiple experiments#3866smondal13 wants to merge 101 commits intoPyomo:mainfrom
Conversation
…`experiment` argument is provided.
…d replace `self.experiment` with `self.experiment_list[0]`. `doe/reactor_example.py` runs successfully.
…sing the `doe/reactor_multi_experiment.py`
…ultiexperiment.py` both for 3 experiments
…etric-uncertainty
…parametric-uncertainty
…nt for `optimize_experiments()` and `compute_FIM()`
… both of sensitivity and optimize_experiments()
…A-opt gave different result for grid and optimization
…omprehensive code review documentation
…and improve Cholesky constraint rules
…ling; enhance logging and thread management
…hance error messaging in optimize_experiments tests
…ion and add multi-experiment example using Rooney-Biegler model
…' into add-multiexperiment
- Moved various tests related to error handling and warnings from test_doe_solve.py to test_doe_errors.py to align with classification rules. - Updated test_doe_errors.py to include new tests for initialization method validation and LHS sample size checks. - Consolidated solver configuration into a helper method for cleaner test setup. - Removed deprecated tests and ensured that all tests are focused on their respective intents (numerical, error handling, and structure). - Added documentation for test classification and design review to improve clarity and maintainability. - Addressed issues with test coverage and robustness, including mocking solver calls for unit tests.
…ated examples/tests
| ] | ||
| sigma_inv = [1 / v for k, v in model.scenario_blocks[0].measurement_error.items()] | ||
| sigma_inv = [ | ||
| 1 / v for k, v in model.fd_scenario_blocks[0].measurement_error.items() |
There was a problem hiding this comment.
I have renamed the block from scenario_blocks to fd_scenario_blocks to make it clearer and avoid ambiguity with param_scenario_blocks, which we will use in the near future.
…experiment optimization in ReactorExperiment.
- Updated the `get_standard_args` function to use `experiment_list` instead of `experiment`. - Added new tests for handling exceptions and fallbacks in FIM computation. - Enhanced tests for parallel execution and timeout handling in LHS sampling. - Removed the `test_multi_exp.py` file as it is no longer needed.
| def __init__( | ||
| self, | ||
| experiment=None, | ||
| experiment_list=None, |
There was a problem hiding this comment.
@adowling2 , @blnicho Should we keep both experiment and experiment_list? The user can pass the experiment_list argument if the user wants to pass the user-initialized experiment object. Another option is to keep the experiment argument and make it able to accept list objects as well, and maybe use a hint, e.g., experiment: list.
Currently, I have added a deprecation warning for the experiment argument.
| "The 'experiment' parameter in DesignOfExperiments is deprecated and " | ||
| "will be removed in a future version. " | ||
| "Please use 'experiment_list' instead.", | ||
| DeprecationWarning, |
There was a problem hiding this comment.
@blnicho Is this DeprecationWarning acceptable, or is there a different approach Pyomo recommends?
| "variable": None, | ||
| "source": None, | ||
| } | ||
| diagnostics_warnings = [] |
There was a problem hiding this comment.
I want to propagate the warning to the final result, which may help the user.
…ing and improve error handling; add utility methods for enum labels and input fixing. Run black
|
@blnicho @adowling2 This PR is ready for an initial review. Please take a look when you have a moment. |
Fixes # .
Summary/Motivation:
This PR adds a new
DesignOfExperiments.optimize_experiments()API inpyomo/contrib/doe/doe.pyto support simultaneous optimization of multiple experiments in one workflow. The motivation is to provide a first-class multi-experiment DoE interface with stronger initialization options, clearer mode handling (template vs. user-initialized experiments), and richer diagnostics/results than the existing single-experiment path.Changes proposed in this PR:
optimize_experiments()for multi-experiment DoE optimization.n_exp.n_expis inferred/validated.initialization_method="lhs") with controls for:sym_break_conssuffix,run_info._DoEResultsJSONEncoderfor numpy/Pyomo-enum values when writingresults_file.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: