Skip to content

Commit

Permalink
Fix mismatch in parameter IDs and point dimensions (#57)
Browse files Browse the repository at this point in the history
in `run_amici_simulation_to_cached_functions`.
  • Loading branch information
dweindl authored Oct 15, 2024
1 parent 2fc3faf commit 8f92753
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fiddy/extensions/amici/amici.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 8f92753

Please sign in to comment.