From 8f92753fa8830875eb04496bdb756e60908e0220 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 15 Oct 2024 07:46:05 +0200 Subject: [PATCH] Fix mismatch in parameter IDs and point dimensions (#57) in `run_amici_simulation_to_cached_functions`. --- fiddy/extensions/amici/amici.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fiddy/extensions/amici/amici.py b/fiddy/extensions/amici/amici.py index e37f81d..5f34e2c 100644 --- a/fiddy/extensions/amici/amici.py +++ b/fiddy/extensions/amici/amici.py @@ -157,7 +157,7 @@ def run_amici_simulation_to_cached_functions( } def run_amici_simulation(point: Type.POINT, order: amici.SensitivityOrder): - problem_parameters = dict(zip(parameter_ids, point, strict=False)) + problem_parameters = dict(zip(parameter_ids, point, strict=True)) amici_model.setParameterById(problem_parameters) amici_solver.setSensitivityOrder(order) rdata = amici.runAmiciSimulation( @@ -205,7 +205,9 @@ def derivative(point: Type.POINT, return_dict: bool = False): derivative = CachedFunction(derivative) # Get structure - dummy_point = fiddy_array(amici_model.getParameters()) + dummy_point = fiddy_array( + [amici_model.getParameterById(par_id) for par_id in parameter_ids] + ) dummy_rdata = run_amici_simulation( point=dummy_point, order=amici.SensitivityOrder.first )