Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _collect_heaviside_roots for sympy.Heaviside arguments #2549

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/sdist/amici/de_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ def _get_unique_root(

def _collect_heaviside_roots(
self,
args: Sequence[sp.Expr],
args: Sequence[sp.Basic],
) -> list[sp.Expr]:
"""
Recursively checks an expression for the occurrence of Heaviside
Expand Down Expand Up @@ -2288,7 +2288,7 @@ def _process_heavisides(
# replace them later by the new expressions
heavisides = []
# run through the expression tree and get the roots
tmp_roots_old = self._collect_heaviside_roots(dxdt.args)
tmp_roots_old = self._collect_heaviside_roots((dxdt,))
for tmp_old in unique_preserve_order(tmp_roots_old):
# we want unique identifiers for the roots
tmp_new = self._get_unique_root(tmp_old, roots)
Expand Down
Loading