Skip to content

Commit

Permalink
Fix SBML import for event-assigned parameters with non-float initial …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
dweindl committed Jul 31, 2023
1 parent 3cd3494 commit fb6b191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/sdist/amici/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fb6b191

Please sign in to comment.