diff --git a/python/sdist/amici/de_export.py b/python/sdist/amici/de_export.py index ef817852e4..46d226b8be 100644 --- a/python/sdist/amici/de_export.py +++ b/python/sdist/amici/de_export.py @@ -51,6 +51,7 @@ from .cxxcodeprinter import AmiciCxxCodePrinter, get_switch_statement from .de_model import * from .import_utils import ( + amici_time_symbol, ObservableTransformation, SBMLException, generate_flux_symbol, @@ -1012,7 +1013,7 @@ def transform_dxdt_to_concentration(species_id, dxdt): # we need to flatten out assignments in the compartment in # order to ensure that we catch all species dependencies v = smart_subs_dict(v, si.symbols[SymbolId.EXPRESSION], "value") - dv_dt = v.diff(si.amici_time_symbol) + dv_dt = v.diff(amici_time_symbol) # we may end up with a time derivative of the compartment # volume due to parameter rate rules comp_rate_vars = [ @@ -1733,7 +1734,7 @@ def _compute_equation(self, name: str) -> None: .replace("sigmarz", "sigmaz") .replace("dJrzdz", "dJrzdrz") ) - time_symbol = sp.Matrix([symbol_with_assumptions("t")]) + time_symbol = sp.Matrix([amici_time_symbol]) if name in self._equation_prototype: self._equation_from_components(name, self._equation_prototype[name]()) diff --git a/python/sdist/amici/import_utils.py b/python/sdist/amici/import_utils.py index 0de2029566..6c2e6b0e7e 100644 --- a/python/sdist/amici/import_utils.py +++ b/python/sdist/amici/import_utils.py @@ -54,10 +54,6 @@ def __init__(self, data): setattr(sys.modules["toposort"], "CircularDependencyError", CircularDependencyError) - -sbml_time_symbol = sp.Symbol("time", real=True) -amici_time_symbol = sp.Symbol("t", real=True) - annotation_namespace = "https://github.com/AMICI-dev/AMICI" @@ -712,3 +708,7 @@ def strip_pysb(symbol: sp.Basic) -> sp.Basic: else: # in this case we will use sympy specific transform anyways return symbol + + +sbml_time_symbol = symbol_with_assumptions("time") +amici_time_symbol = symbol_with_assumptions("t") diff --git a/python/sdist/amici/sbml_import.py b/python/sdist/amici/sbml_import.py index 39b7b64ed5..365e3441a6 100644 --- a/python/sdist/amici/sbml_import.py +++ b/python/sdist/amici/sbml_import.py @@ -1253,10 +1253,6 @@ def _process_time(self) -> None: """ Convert time_symbol into cpp variable. """ - sbml_time_symbol = symbol_with_assumptions("time") - amici_time_symbol = symbol_with_assumptions("t") - self.amici_time_symbol = amici_time_symbol - self._replace_in_all_expressions(sbml_time_symbol, amici_time_symbol) def _convert_event_assignment_parameter_targets_to_species(self):