Skip to content

Add standalone reference tests for cellular ODE models - #627

Open
samibismar wants to merge 9 commits into
SimVascular:mainfrom
samibismar:feature-ode-unit-test
Open

Add standalone reference tests for cellular ODE models#627
samibismar wants to merge 9 commits into
SimVascular:mainfrom
samibismar:feature-ode-unit-test

Conversation

@samibismar

Copy link
Copy Markdown
Contributor

Resolves #597.

Current situation

The existing regression tests for cellular ODE models use reference solutions generated by svMultiPhysics itself and are generally coupled to larger 3D problems.

This PR adds standalone unit tests for ionic and active-stress models using independently generated reference trajectories.

Release Notes

  • Added shared trajectory-test infrastructure for IonicModel and ActiveStress.
  • Added full-state reference tests for:
    • Aliev-Panfilov
    • FitzHugh-Nagumo
    • Bueno-Orovio EPI, ENDO, and M
    • ten Tusscher-Panfilov 2006 EPI, ENDO, and M
    • Nash-Panfilov
    • Regazzoni/RDQ20-MF
  • Ionic-model tests start from their initial/rest states, apply a time-dependent stimulus, and verify the resulting transient.
  • Active-stress tests use prescribed calcium and mechanical inputs to verify the full model-state trajectory.
  • Added reference CSVs under tests/unitTests/reference_data/.
  • Added independent reference generators and a verifier under tests/unitTests/reference_generators/.

Testing

  • Full unit-test suite passes: 252/252.
  • Reference-data verification passes for all 10 trajectories.

Code of Conduct & Contributing Guidelines

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@samibismar

Copy link
Copy Markdown
Contributor Author

The Regazzoni reference generator currently uses the authors’ C++ implementation at a pinned commit, so regenerating it requires a local clone of cardiac-activation together with Eigen, Boost, and a C++ compiler. I chose this rather than maintaining another transcription of RDQ20-MF, since it keeps the reference tied directly to the authors’ implementation.

I did consider making it more self-contained, either by optionally fetching the pinned source automatically or by writing an independent Python version similar to the TP06 generator. I also wasn’t sure whether bundling or automatically fetching an external reference implementation is something we want to do in svMultiPhysics, so I didn’t want to make that choice without asking. I’d be happy to change the workflow if you think a more self-contained approach would be preferable.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.24230% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.08%. Comparing base (9ff6e43) to head (e8915ef).

Files with missing lines Patch % Lines
...Tests/ionic_model_tests/ionic_model_test_helpers.h 78.00% 44 Missing ⚠️
...s/active_stress_tests/active_stress_test_helpers.h 86.78% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #627      +/-   ##
==========================================
+ Coverage   72.86%   73.08%   +0.22%     
==========================================
  Files         258      266       +8     
  Lines       39500    39980     +480     
  Branches     6730     6797      +67     
==========================================
+ Hits        28780    29221     +441     
- Misses      10477    10516      +39     
  Partials      243      243              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

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.

Verification and testing of cellular ODE-based models

1 participant