Skip to content

Port matlab test models to Python#2898

Merged
dweindl merged 1 commit intoAMICI-dev:mainfrom
dweindl:port_matlab_tests
Jul 17, 2025
Merged

Port matlab test models to Python#2898
dweindl merged 1 commit intoAMICI-dev:mainfrom
dweindl:port_matlab_tests

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Jul 14, 2025

  • Implements all current MATLAB test models in Python, except those for second-order sensitivities
    (the jakstat_adjoint example has a slightly different spline, because the old one is not exactly reproducible with the Python-AMICI spline-handling; the rest should be re-implemented pretty accurately). Model generation code is in amici.testing.models.
  • Generates HDF5 files with expected test results via Python. This file is now stored on Git LFS.
  • The model code is again added to the repository for faster testing and to quickly notice any changes in the generated code.
  • The original MATLAB code is retained for testing the MATLAB interface until Drop MATLAB interface #2727.
  • Some test code is partially duplicated to make it easier to remove the MATLAB-related code in Drop MATLAB interface #2727.

Closes #2822.
Closes #854.

@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

❌ Patch coverage is 58.83689% with 906 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.96%. Comparing base (f83f92d) to head (d4eb8e2).
⚠️ Report is 60 commits behind head on main.

Files with missing lines Patch % Lines
models/model_calvetti_py/model_calvetti_py.h 56.05% 69 Missing ⚠️
models/model_dirac_py/model_dirac_py.h 57.61% 64 Missing ⚠️
...ls/model_nested_events_py/model_nested_events_py.h 61.68% 59 Missing ⚠️
models/model_events_py/model_events_py.h 65.26% 58 Missing ⚠️
...odel_jakstat_adjoint_py/model_jakstat_adjoint_py.h 70.51% 46 Missing ⚠️
models/model_calvetti_py/main.cpp 0.00% 45 Missing ⚠️
models/model_dirac_py/main.cpp 0.00% 45 Missing ⚠️
models/model_events_py/main.cpp 0.00% 45 Missing ⚠️
models/model_jakstat_adjoint_py/main.cpp 0.00% 45 Missing ⚠️
models/model_nested_events_py/main.cpp 0.00% 45 Missing ⚠️
... and 40 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2898      +/-   ##
==========================================
- Coverage   80.28%   78.96%   -1.32%     
==========================================
  Files         330      358      +28     
  Lines       22660    23007     +347     
  Branches     1531     1570      +39     
==========================================
- Hits        18192    18167      -25     
- Misses       4458     4829     +371     
- Partials       10       11       +1     
Flag Coverage Δ
cpp 74.88% <58.83%> (-0.60%) ⬇️
cpp_python 33.19% <0.00%> (-0.54%) ⬇️
petab 39.00% <ø> (-0.15%) ⬇️
python 73.76% <58.83%> (-0.69%) ⬇️
sbmlsuite-jax ?

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

Files with missing lines Coverage Δ
models/model_calvetti_py/create_splines.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/dwdw.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/dwdx.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/dxdotdw.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/dxdotdx_explicit.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/root.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/sigmay.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/w.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/wrapfunctions.cpp 100.00% <100.00%> (ø)
models/model_calvetti_py/x0.cpp 100.00% <100.00%> (ø)
... and 134 more

... and 235 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 force-pushed the port_matlab_tests branch 2 times, most recently from 4c82983 to 6a6b537 Compare July 14, 2025 12:48
@dweindl dweindl self-assigned this Jul 14, 2025
@dweindl dweindl force-pushed the port_matlab_tests branch 2 times, most recently from d30d739 to 189dfc5 Compare July 15, 2025 07:08
@socket-security
Copy link

socket-security bot commented Jul 15, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedamici@​0.33.09610010010070

View full report

@dweindl dweindl force-pushed the port_matlab_tests branch from 91c6470 to 1c3846c Compare July 16, 2025 19:10
@dweindl dweindl force-pushed the port_matlab_tests branch from 1c3846c to d4eb8e2 Compare July 16, 2025 19:44
@dweindl dweindl mentioned this pull request Jul 16, 2025
15 tasks
@dweindl dweindl marked this pull request as ready for review July 16, 2025 19:52
@dweindl dweindl requested a review from a team as a code owner July 16, 2025 19:52
dweindl added a commit to dweindl/AMICI that referenced this pull request Jul 16, 2025
When applying the chain rule factor, avoid NaN-propagation in case of zero-multiplications.

(Will allow enabling the `ExampleJakstatAdjoint.SensitivityAdjointUnusedNanOutputs` test (AMICI-dev#686) after AMICI-dev#2898.)
github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2025
When applying the chain rule factor, avoid NaN-propagation in case of zero-multiplications.

(Will allow enabling the `ExampleJakstatAdjoint.SensitivityAdjointUnusedNanOutputs` test (#686) after #2898.)
@dweindl dweindl merged commit a71c990 into AMICI-dev:main Jul 17, 2025
17 of 19 checks passed
@dweindl dweindl deleted the port_matlab_tests branch July 17, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start porting MATLAB-based tests to Python Run full model code generation for test models during CI from Python

2 participants