Testing
Testing scientific code can present a chicken-and-egg problem: the reference data used to verify results is often generated by the very code being tested. While this kind of regression testing catches unintended changes, it cannot detect logical errors in the original implementation. Where possible, test data should therefore be computed using independent, external tools.
When external reference data is not available, we recommend writing tests that produce figures (with matplotlib) for manual inspection. Once verified, these figures serve as reference images for automated comparison in future test runs via the pytest-mpl extension.