ewoksxas.resources.data.regenerate_reference#
Regenerate the reference snapshots used by the test suite.
The tests compare computed arrays against stored .npz snapshots (in the
snapshots directory next to this module) with a tolerance, which is portable
across operating systems where byte-level hashing is not. Run this only after a
dependency change (e.g. a larch upgrade) has been reviewed and accepted, to
refresh those snapshots:
python -m ewoksxas.resources.data.regenerate_reference # all
python -m ewoksxas.resources.data.regenerate_reference autobk_chi # one
Adding a snapshot for a new test takes two steps:
Write a builder function returning a
dictof arrays and register it inSNAPSHOTSunder the snapshot name.In the test, load it with
np.load(resource_filename("ewoksxas:data/snapshots/<name>.npz"))and compare withnumpy.testing.assert_allclose.
The data-loading helpers mirror the fixtures in tasks/tests/conftest.py.
Functions
|
Regenerate the snapshots named on the command line, or all of them. |
Return a single normalized Fe-foil spectrum, as the fe_foil_one fixture. |
|
Return the raw Fe-foil scans, as the fe_foil_data fixture does. |
|
|
Rebuild one snapshot and write it into the snapshots directory. |