From 6bbdfec1e3512c10b84d66e9d22a457859ec7281 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 12 Nov 2025 11:45:18 +0100 Subject: [PATCH] Don't use `is` comparisons for sympy objects `is` comparisons for `sympy.Symbol` or other sympy expressions are fragile and shouldn't be relied on. --- python/sdist/amici/importers/sbml/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sdist/amici/importers/sbml/__init__.py b/python/sdist/amici/importers/sbml/__init__.py index 913608f920..295417b13b 100644 --- a/python/sdist/amici/importers/sbml/__init__.py +++ b/python/sdist/amici/importers/sbml/__init__.py @@ -2714,7 +2714,7 @@ def _clean_reserved_symbols(self) -> None: if old_symbol in symbols: # reconstitute the whole dict in order to keep the ordering self.symbols[symbols_ids] = { - new_symbol if k is old_symbol else k: v + new_symbol if k == old_symbol else k: v for k, v in symbols.items() }