Merged
Conversation
First commit for DoE refactor. Skeleton functions added for development.
Mid-way through updating the scenario generation for the finite difference of the sensitivity matrix. Added an example file from the refactor hack-a-thon in November 2023.
Worked around Block construction. Pass-by-reference issues with with Experiment object requires some sort of cloning of the model for each block. Still working through global connecting constraints for design variables.
Finished some more edits. Will check back in tomorrow to clean and make sure the scenario generator is working properly. Need to work on whether the full model should be present or not for the central case. Could use the "global model" to be "case 0" and reassign the values to be one of the cases.
Add functionality to test if the labeled model has the expected labels for the DoE model to be created.
Added FiniteDifferenceStep initialization to the constructor. Removed and cleaned some defunct commenting/documentation.
Significant development in create_doe_model. Modernized to new methodology. Tests to follow.
Added size checks to make sure everything is consistent before being automatically generated by the create_model function.
Made the Jacobian representation consistent with the paper as well as sources on what the sensitivity matrix should be (i.e., (n_experiment_outputs x n_parameters) such that Q^T @ Q is (n_parameters x n_parameters).
Changed how the tree is traversed so the parameter location starts after the "base_model" or "scenario_blocks[0]" keyword. This way, an arbitrary block structure should be support. This will help for making multiple instances of the DoE model (i.e., multiple simultaneous estimations or stochastic-based experiment implementation).
Also updated the test build, result.json, and experiment class example to be well-posed DoE models.
Also added documentation for the inputs.
Seems to work based on comparison to old code. Will look into this more later.
Also updated the test files and results file to match and generate the same optimal point.
Matches the old interface
Objective cons block are deactivated for the square solve as they can sometimes cause convergence issues.
Will add back before pushing
blnicho
reviewed
Aug 14, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3317 +/- ##
==========================================
+ Coverage 88.56% 88.60% +0.04%
==========================================
Files 877 873 -4
Lines 99276 99133 -143
==========================================
- Hits 87920 87840 -80
+ Misses 11356 11293 -63
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
blnicho
approved these changes
Aug 15, 2024
Member
blnicho
left a comment
There was a problem hiding this comment.
Assuming the Jenkins tests pass, I think this is ready
Contributor
Author
mrmundt
reviewed
Aug 19, 2024
| outputs = [k.name for k, v in model.measurement_error.items()] | ||
| except: | ||
| raise RuntimeError( | ||
| "Experiment model does not have suffix " + '"measurement_error".' |
mrmundt
reviewed
Aug 19, 2024
| plt.pyplot.rc("ytick", labelsize=font_tick) | ||
| ax = fig.add_subplot(111) | ||
| params = {"mathtext.default": "regular"} | ||
| # plt.rcParams.update(params) |
mrmundt
reviewed
Aug 19, 2024
| plt.pyplot.rc("ytick", labelsize=font_tick) | ||
| ax = fig.add_subplot(111) | ||
| params = {"mathtext.default": "regular"} | ||
| # plt.rcParams.update(params) |
mrmundt
approved these changes
Aug 19, 2024
Contributor
mrmundt
left a comment
There was a problem hiding this comment.
There are a couple of lines that I think need to be removed, but they aren't essential, so approve.
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.
Fixes
Pyomo.DoE interface was made more intuitive and some bugs were removed.
Summary/Motivation:
Pyomo.DoE was refactored to coincide with the new "experiment-based" structure of ParmEst. In this way, the packages should overlap with syntax and workflows using both tools should be easier to implement. Also, the existing interface was clunky and required a few bugfixes.
Changes proposed in this PR:
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: