Skip to content

Commit 1fe3a9f

Browse files
authored
SBML import: Handle unsolvable event triggers (#2705)
Not all event trigger functions can be solved for `time` when trying to compute the trigger time. Handle sympy errors in that case. This location was missed in #2686.
1 parent 9ea6aef commit 1fe3a9f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

python/sdist/amici/de_model_components.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,11 @@ def __init__(
737737
self._initial_value = initial_value
738738

739739
# expression(s) for the timepoint(s) at which the event triggers
740-
self._t_root = sp.solve(self.get_val(), amici_time_symbol)
740+
try:
741+
self._t_root = sp.solve(self.get_val(), amici_time_symbol)
742+
except NotImplementedError:
743+
# the trigger can't be solved for `t`
744+
self._t_root = []
741745

742746
def get_initial_value(self) -> bool:
743747
"""

0 commit comments

Comments
 (0)