From fb6b191434916f0402ae55ca5df9aa8b59ab34bd Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 31 Jul 2023 12:48:34 +0200 Subject: [PATCH] Fix SBML import for event-assigned parameters with non-float initial assignments Currently it is incorrectly assumed that the initial value of an event-assigned parameter is (convertible to) a float. Therefore, SBML import fails if the initial assignment contains a symbolic expression that can't be floatified. Fixes #2149. --- python/sdist/amici/sbml_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sdist/amici/sbml_import.py b/python/sdist/amici/sbml_import.py index d37cc7b9c0..bb4a961aec 100644 --- a/python/sdist/amici/sbml_import.py +++ b/python/sdist/amici/sbml_import.py @@ -1388,7 +1388,7 @@ def _convert_event_assignment_parameter_targets_to_species(self): # targets of events. self.symbols[SymbolId.SPECIES][parameter_target] = { "name": parameter_def["name"], - "init": sp.Float(parameter_def["value"]), + "init": sp.sympify(parameter_def["value"]), # 'compartment': None, # can ignore for amounts "constant": False, "amount": True,