Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/test_sbml_semantic_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- .github/workflows/test_sbml_semantic_test_suite.yml
- python/sdist/amici/de_export.py
- python/sdist/amici/de_model_components.py
- python/sdist/amici/de_model.py
- python/sdist/amici/sbml_import.py
- python/sdist/amici/import_utils.py
- scripts/run-SBMLTestsuite.sh
Expand Down
17 changes: 12 additions & 5 deletions python/sdist/amici/de_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1693,19 +1693,26 @@
]

elif name == "deltasx":
if self.num_states_solver() * self.num_par() == 0:
if (
self.num_states_solver() * self.num_par() * self.num_events()
== 0
):
self._eqs[name] = []
return

xdot_is_zero = smart_is_zero_matrix(self.eq("xdot"))

Check warning on line 1703 in python/sdist/amici/de_model.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/de_model.py#L1703

Added line #L1703 was not covered by tests

event_eqs = []
for ie, event in enumerate(self._events):
tmp_eq = sp.zeros(self.num_states_solver(), self.num_par())

# need to check if equations are zero since we are using
# symbols
if not smart_is_zero_matrix(
self.eq("stau")[ie]
) and not smart_is_zero_matrix(self.eq("xdot")):

if (

Check warning on line 1712 in python/sdist/amici/de_model.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/de_model.py#L1712

Added line #L1712 was not covered by tests
not smart_is_zero_matrix(self.eq("stau")[ie])
and not xdot_is_zero
):
tmp_eq += smart_multiply(
self.sym("xdot") - self.sym("xdot_old"),
self.sym("stau").T,
Expand Down Expand Up @@ -1739,7 +1746,7 @@
self.eq("ddeltaxdx")[ie], tmp_dxdp
)

else:
elif not xdot_is_zero:

Check warning on line 1749 in python/sdist/amici/de_model.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/de_model.py#L1749

Added line #L1749 was not covered by tests
tmp_eq = smart_multiply(
self.sym("xdot") - self.sym("xdot_old"),
self.eq("stau")[ie],
Expand Down
Loading