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