-
Notifications
You must be signed in to change notification settings - Fork 47
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
Semiquant: Add spline knots to the optimization result #1314
Conversation
Adds spline knots to the optimization result so they can be easily obtained after optimization. This then allows easy further use, if needed.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1314 +/- ##
===========================================
- Coverage 84.48% 84.44% -0.04%
===========================================
Files 153 153
Lines 12455 12478 +23
===========================================
+ Hits 10522 10537 +15
- Misses 1933 1941 +8 ☔ View full report in Codecov by Sentry. |
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.
only looked at changes in pypesto/objective/amici/amici.py
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
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.
Do we have a test yet, saving and loading this results? If not, please add before merging. Otherwise looks good to me
Added a test to |
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.
I don't see any issues in the visualize/spline_approximation.py. For the future it would be useful to have you as a codeowner of that file.
Co-authored-by: Maren Philipps <55318391+m-philipps@users.noreply.github.com>
Fixes #1308 by saving the spline knots in the
OptimizerResult
object underspline_knots
in the form oflist[list[np.array[float], np.array[float]]]
. Each list in the first level corresponds to a semiquantitative observable. Each of these lists contains two arrays: the first array contains the spline bases, the second array contains the spline knot values. The ordering of the observable lists is the same as inpypesto.problem.hierarchical.semiquant_observable_ids
.This also allows the visualization
plot_splines_from_pypesto_result
to just extract the spline knot values from the pypesto result object instead of solving the inner problem to get them. The latter could even a bit wrong due to possibly different initial conditions of the inner optimization problem.Except this, there is some random cleanup here and there.