ICB-DCM / pyPESTO

python Parameter EStimation TOolbox
https://pypesto.readthedocs.io
BSD 3-Clause "New" or "Revised" License
217 stars 47 forks source link

Relative: Fix return of inner parameters on objective call #1333

Closed Doresic closed 6 months ago

Doresic commented 6 months ago

There was a bad implementation of inner parameter returning on call of objective. Previously, the InnerCalculatorCollector would take note of self.best_fval such that it returns inner_parameters only in cases a better objective function value was found. This was ok during optimization, but then if one wanted to get inner parameters for some other outer parameter vector for which the objective function would not be better, the inner parameters would not be returned.

This is bad practice: to save current states in the calculator and objective objects. So now, after an optimization start is finished, the hierarchical_decorator instead calls the objective once more with the best outer parameters found to obtain the inner parameters for that outer vector.

There some small update in the visualize of model_fit.time_trajectory_model. Was not working with the current implementation due to recent hierarchical structure changes.

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 84.26%. Comparing base (9cf4bf2) to head (476c2b6).

Files Patch % Lines
pypesto/visualize/model_fit.py 50.00% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1333 +/- ## ======================================== Coverage 84.25% 84.26% ======================================== Files 152 152 Lines 12452 12441 -11 ======================================== - Hits 10492 10483 -9 + Misses 1960 1958 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.