Closed arrjon closed 7 months ago
This is expected and unrelated to hierarchical optimization. See also this example. The objective is not saved, you'll have to set result.problem
to the Problem
used to generate the result. You should have seen a warning when loading from file. If not, this might be due to #1252 (fixed in amici>=v0.21.0).
I thought I reloaded the problem, but it turns out I forgot to assign it to the result.
Adding result.problem = problem
solved it. Thanks!
Bug description When loading a result object from hierachical optimisation and calling
plot_splines_from_pypesto_result
this results inAttributeError: 'Objective' object has no attribute 'calculator'
even though it worked when working with the original results object.Expected behavior After loading a result object plotting functions should still work. If think this is related to #1308.
To reproduce Minimal example using the example_semiquantitative petab problem: minimal_example.py.zip Run the script twice: first to produce a result object and store it. Everything works as expected. Rerun it, this will create the problem in the same way, but it will load the result object instead of creating it. The error appears then in the last function call.
Environment
pypesto
version: todays develop branch