diff --git a/python/sdist/amici/cxxcodeprinter.py b/python/sdist/amici/cxxcodeprinter.py index adc4c25454..fb98b0aca0 100644 --- a/python/sdist/amici/cxxcodeprinter.py +++ b/python/sdist/amici/cxxcodeprinter.py @@ -339,7 +339,7 @@ def csc_matrix( for col in range(ncols): symbol_col_ptrs.append(idx) for row in range(nrows): - if matrix[row, col] == 0: + if matrix[row, col].is_zero: continue symbol_row_vals.append(row) diff --git a/python/sdist/amici/de_model.py b/python/sdist/amici/de_model.py index b69cc6ba68..ea2807df52 100644 --- a/python/sdist/amici/de_model.py +++ b/python/sdist/amici/de_model.py @@ -2115,7 +2115,7 @@ def state_is_constant(self, ix: int) -> bool: if isinstance(state, AlgebraicState): return False - return state.get_dt() == 0.0 + return state.get_dt().is_zero def conservation_law_has_multispecies(self, tcl: ConservationLaw) -> bool: """ @@ -2179,7 +2179,7 @@ def _get_unique_root( return None for root in roots: - if sp.simplify(root_found - root.get_val()) == 0: + if sp.simplify(root_found - root.get_val()).is_zero: return root.get_id() # create an event for a new root function