Skip to content

Commit

Permalink
Don't eliminate parameters that are initial assignment targets (pt2)
Browse files Browse the repository at this point in the history
Currently, parameters that are targets of initial assignments don't show up as parameters or expressions in the amici model. This is rather not what most users would expect.

Therefore, treat all SBML parameters that are initial assignment targets and whose initial assignment does not evaluate to a number (for those that do, see AMICI-dev#2304) as amici expressions.
Those static expressions will be handled more efficiently after AMICI-dev#2303.

Related to AMICI-dev#2150.
  • Loading branch information
dweindl committed Feb 22, 2024
1 parent 4334557 commit 1697b18
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/sdist/amici/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,14 +1095,12 @@ def _process_parameters(
}

# Parameters that need to be turned into expressions
# so far, this concerns parameters with initial assignments containing rateOf(.)
# so far, this concerns parameters with symbolic initial assignments
# (those have been skipped above)
for par in self.sbml.getListOfParameters():
if (
ia := self._get_element_initial_assignment(par.getId())
) is not None and ia.find(
sp.core.function.UndefinedFunction("rateOf")
):
) is not None and not ia.is_Number:
self.symbols[SymbolId.EXPRESSION][
_get_identifier_symbol(par)
] = {
Expand Down

0 comments on commit 1697b18

Please sign in to comment.