From b2477ea4ce41f982e5f6c549b072e7f43069c48c Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 30 Jun 2025 09:26:48 +0200 Subject: [PATCH] SBML import: Boolean handling Test. Related to #2840. --- python/sdist/amici/sbml_import.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/python/sdist/amici/sbml_import.py b/python/sdist/amici/sbml_import.py index 131db1a041..be3b007aee 100644 --- a/python/sdist/amici/sbml_import.py +++ b/python/sdist/amici/sbml_import.py @@ -1471,6 +1471,7 @@ def _process_reactions(self): self.stoichiometric_matrix[ species["index"], reaction_index ] += sign * stoichiometry * species["conversion_factor"] + if reaction.isSetId(): sym_math = self._local_symbols[reaction.getId()] else: @@ -1478,12 +1479,8 @@ def _process_reactions(self): reaction.getKineticLaw() or sp.Float(0) ) - self.flux_vector[reaction_index] = sym_math.subs( - { - BooleanTrue(): sp.Float(1.0), - BooleanFalse(): sp.Float(0.0), - } - ) + self.flux_vector[reaction_index] = sym_math + if any( str(symbol) in reaction_ids for symbol in self.flux_vector[reaction_index].free_symbols