Skip to content

Speed up DEModel._collect_heaviside_roots#2977

Merged
dweindl merged 2 commits intoAMICI-dev:mainfrom
dweindl:faster__collect_heaviside_roots
Oct 15, 2025
Merged

Speed up DEModel._collect_heaviside_roots#2977
dweindl merged 2 commits intoAMICI-dev:mainfrom
dweindl:faster__collect_heaviside_roots

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Oct 14, 2025

Avoid unnecessary repeated toposorting of w during _collect_heaviside_root. Sort and substitute only once after all roots have been collected. This saves a couple of seconds for models with heavily nested piecewise functions.

Avoid unnecessary repeated toposorting of `w` during `_collect_heaviside_root`.
Sort and substitute only once after all roots have been collected.
This saves a couple of seconds for models with heavily nested piecewise functions.
@dweindl dweindl self-assigned this Oct 14, 2025
@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.80%. Comparing base (11781f5) to head (8a75dd9).
⚠️ Report is 112 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
- Coverage   76.49%   75.80%   -0.70%     
==========================================
  Files         307      307              
  Lines       19991    19992       +1     
  Branches     1501     1500       -1     
==========================================
- Hits        15293    15154     -139     
- Misses       4685     4825     +140     
  Partials       13       13              
Flag Coverage Δ
cpp 71.97% <100.00%> (-0.03%) ⬇️
cpp_python 38.21% <100.00%> (+<0.01%) ⬆️
petab 39.27% <100.00%> (+0.02%) ⬆️
python 69.54% <100.00%> (-0.03%) ⬇️
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/sdist/amici/de_model.py 92.36% <100.00%> (-0.41%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl dweindl marked this pull request as ready for review October 14, 2025 13:22
@dweindl dweindl requested a review from a team as a code owner October 14, 2025 13:22
@dweindl dweindl enabled auto-merge October 14, 2025 20:46
@dweindl dweindl added this pull request to the merge queue Oct 14, 2025
Merged via the queue into AMICI-dev:main with commit a666ef9 Oct 15, 2025
23 of 24 checks passed
@dweindl dweindl deleted the faster__collect_heaviside_roots branch October 15, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants