From 9490718f0fc2c357256f79fe1a0d5f189092d8ce Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 28 Aug 2025 13:40:30 +0200 Subject: [PATCH 1/2] Avoid sympification in is-None checks Don't sympify if we just need to test some expression to be (not) None. Saves some time for expensive-to-sympify expressions like big piecewise constructs for splines. --- python/sdist/amici/sbml_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sdist/amici/sbml_import.py b/python/sdist/amici/sbml_import.py index ec827a5ed4..79ca93cf72 100644 --- a/python/sdist/amici/sbml_import.py +++ b/python/sdist/amici/sbml_import.py @@ -3048,7 +3048,7 @@ def is_assignment_rule_target(self, element: libsbml.SBase) -> bool: boolean indicating truth of function name """ a = self.sbml.getAssignmentRuleByVariable(element.getId()) - return a is not None and self._sympify(a) is not None + return a is not None and a.getMath() is not None def is_rate_rule_target(self, element: libsbml.SBase) -> bool: """ @@ -3062,7 +3062,7 @@ def is_rate_rule_target(self, element: libsbml.SBase) -> bool: boolean indicating truth of function name """ a = self.sbml.getRateRuleByVariable(element.getId()) - return a is not None and self._sympify(a) is not None + return a is not None and a.getMath() is not None def _transform_dxdt_to_concentration( self, species_id: sp.Symbol, dxdt: sp.Expr From 735ce82390b984a17a462b02aa68a8b79855ffce Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sat, 30 Aug 2025 11:09:00 +0200 Subject: [PATCH 2/2] pytest-rerunfailures!=16.0 --- python/sdist/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sdist/pyproject.toml b/python/sdist/pyproject.toml index 2592e38f8f..228fa76ac5 100644 --- a/python/sdist/pyproject.toml +++ b/python/sdist/pyproject.toml @@ -65,7 +65,8 @@ test = [ "h5py", "pytest", "pytest-cov", - "pytest-rerunfailures", + # v16.0: https://github.com/pytest-dev/pytest-rerunfailures/issues/302 + "pytest-rerunfailures!=16.0", "coverage", "shyaml", "antimony>=2.13",