From 022de60375f7095a6a580756b7dfcd19edb540d1 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 19 Nov 2024 12:58:50 +0100 Subject: [PATCH] Faster fill_in_parameters_for_condition (#2586) Avoid unnecessary repeated dict creation. This matters for problems with large numbers of parameters. --- python/sdist/amici/petab/conditions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sdist/amici/petab/conditions.py b/python/sdist/amici/petab/conditions.py index ab06e8850d..2d72858580 100644 --- a/python/sdist/amici/petab/conditions.py +++ b/python/sdist/amici/petab/conditions.py @@ -156,8 +156,9 @@ def _get_par(model_par, value, mapping): key: _get_par(key, val, map_sim_fix) for key, val in map_sim_fix.items() } + map_sim_fix_var = map_sim_fix | map_sim_var map_sim_var = { - key: _get_par(key, val, dict(map_sim_fix, **map_sim_var)) + key: _get_par(key, val, map_sim_fix_var) for key, val in map_sim_var.items() }