-
Notifications
You must be signed in to change notification settings - Fork 546
Pyomo.DoE: adding more verbose output for sensitivity analysis #3525
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
base: main
Are you sure you want to change the base?
Conversation
@adowling2 @djlaky ready for early feedback |
Next step:
|
@smondal13 See #3532 for an example of what @jsiirola is suggesting |
…alue checking in compute_FIM_full_factorial()
…pute_FIM_metrics` function.
… doe object that uses the "reactor_experiment" example in doe directory. Also added the png files to gitignore that are stored when "reactor_example.py" is run.
6e68c2b
to
e9e83b6
Compare
added print statement and changed a_tol of np.allclose for "log10 D-opt"
8e4a5fb
to
baa817b
Compare
@blnicho, I have added the print statement, and on my Mac, the values of "log10 D-opt" are exactly the same as the "log10_D_opt_expected" values. I have also solved the import issue. |
self.assertTrue( | ||
np.allclose(ff_results["log10 D-opt"], log10_D_opt_expected, atol=1e-6) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are still failing due to slight numerical differences across different operating systems. Try changing these to use self.assertStructuredAlmostEqual(value, expected)
instead of the combo of assertTrue
and np.allclose
. I think this will print out which values are different when the test fails without needing the explicit print statement you added above. You may have to use Python lists of floats instead of numpy arrays and data types. Once we figure out the tolerance to use for "log10 D-opt", I'm expecting we'll see similar numerical issues with the checks below.
self.assertTrue( | |
np.allclose(ff_results["log10 D-opt"], log10_D_opt_expected, atol=1e-6) | |
) | |
self.assertStructuredAlmostEqual(ff_results["log10 D-opt"], log10_D_opt_expected, abstol=1e-4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blnicho, I have changed the design_ranges
for the example in test_doe_solve.py
. Previously, the values of D-opt were very small. I have also changed the datatype of the lists. These changes will probably solve the numerical issue.
Co-authored-by: Bethany Nicholson <[email protected]>
…ged the expected values in class TestDoe from list of numpy floats to list of floats.
@smondal13 the lint check failed. Please run |
@blnicho, I have changed the example again. This time, it has passed all the checks, except one. |
Fixes # .
Summary/Motivation:
get_labeled_model()
.reactor_example.py
will help with the testing.Changes proposed in this PR:
compute_FIM_full_factorial()
check_FIM()
in utils.py by separating it fromcheck_model_FIM()
in doe.pycompute_FIM_metrics()
in utils.pyget_FIM_metrics()
in utils.pyreactor_example.py
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: