Skip to content

Add unit tests for integrator implementation(s)#32

Open
matt-graham wants to merge 3 commits into
mainfrom
mmg/integrator-unit-tests
Open

Add unit tests for integrator implementation(s)#32
matt-graham wants to merge 3 commits into
mainfrom
mmg/integrator-unit-tests

Conversation

@matt-graham

Copy link
Copy Markdown
Collaborator

Adds some basic unit tests for integrators (currently only LeapfrogIntegrator but should be simple to extend to other integrator types) that checks that a few key invariants are maintained by each integrator step:

  • that each step keeps all phase point components finite and with a non-zero step size changes all phase point components;
  • that the composition of a step, momentum flip, another step, and then another momentum flip is an identity map (so that the integrator is time-reversible);
  • that a step with a zero step size $\epsilon$ does not change any of phase point components;
  • that integrating over multiple steps the Hamiltonian of the system remains approximately conserved.

@matt-graham matt-graham added the tests Issues or pull-requests relating to testing label May 15, 2026
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.36%. Comparing base (34d4ce2) to head (ef9c2c5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #32   +/-   ##
=======================================
  Coverage   89.36%   89.36%           
=======================================
  Files           7        7           
  Lines         141      141           
=======================================
  Hits          126      126           
  Misses         15       15           

☔ View full report in Codecov by Sentry.
📢 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.

@matt-graham matt-graham force-pushed the mmg/integrator-unit-tests branch from 33dfc17 to ef9c2c5 Compare May 15, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Issues or pull-requests relating to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant