![]() |
FairShip
|
Functions | |
| _is_lfs_pointer (path) | |
| _discover () | |
| loaded () | |
| expectation (stem) | |
| test_map_is_expected (path) | |
| test_binning_is_consistent (path) | |
| test_coordinates_follow_the_assumed_order (path) | |
| test_divergence_prefers_the_stored_order (path, loaded) | |
| test_expected_component_dominates_on_axis (path, loaded) | |
Variables | |
| str | MAP_DIRECTORY = Path(__file__).resolve().parent.parent / "files" |
| dict | EXPECTED |
| MAPS = _discover() | |
| pytestmark = pytest.mark.skipif(not MAPS, reason="no field maps in files/ (git-lfs objects not fetched?)") | |
Check that every shipped field map is stored the way ShipBFieldMap reads it. The reader streams the ``Data`` tree sequentially and indexes it as ``(iX*Ny + iY)*Nz + iZ``. Nothing in the file states that ordering, and when ``Nx == Ny`` with matching x and y ranges a transposed map still has the right number of entries, so it is read mirrored about the x = y plane without a single complaint. That is what happened to the default spectrometer map. Two things pin the ordering down. The stored node coordinates say what the writer intended, and the divergence of the field says what is actually in the file: a physical field has div B = 0, and no transposition survives that.
|
protected |
Every readable field map in files/. Unfetched git-lfs pointers are dropped one by one rather than taken as a reason to skip the lot, so a partly fetched checkout still checks the maps it does have.
Definition at line 50 of file test_field_maps.py.
|
protected |
Definition at line 45 of file test_field_maps.py.
| test_field_maps.expectation | ( | stem | ) |
What this map should look like, or a skip if nobody has said.
Definition at line 74 of file test_field_maps.py.
| test_field_maps.loaded | ( | ) |
Every map read once, as ``{stem: (range, field)}``.
Definition at line 69 of file test_field_maps.py.
| test_field_maps.test_binning_is_consistent | ( | path | ) |
Definition at line 91 of file test_field_maps.py.
| test_field_maps.test_coordinates_follow_the_assumed_order | ( | path | ) |
The regression test: a transposed map is off by tens of bins here.
Definition at line 102 of file test_field_maps.py.
| test_field_maps.test_divergence_prefers_the_stored_order | ( | path, | |
| loaded ) |
div B = 0 only holds for the reading that matches the file.
Definition at line 119 of file test_field_maps.py.
| test_field_maps.test_expected_component_dominates_on_axis | ( | path, | |
| loaded ) |
Catches a Bx/By column swap, which leaves div B untouched.
Definition at line 130 of file test_field_maps.py.
| test_field_maps.test_map_is_expected | ( | path | ) |
A new map has to be added to EXPECTED deliberately, not by accident.
Definition at line 82 of file test_field_maps.py.
| dict test_field_maps.EXPECTED |
Definition at line 34 of file test_field_maps.py.
| str test_field_maps.MAP_DIRECTORY = Path(__file__).resolve().parent.parent / "files" |
Definition at line 23 of file test_field_maps.py.
| test_field_maps.MAPS = _discover() |
Definition at line 63 of file test_field_maps.py.
| test_field_maps.pytestmark = pytest.mark.skipif(not MAPS, reason="no field maps in files/ (git-lfs objects not fetched?)") |
Definition at line 65 of file test_field_maps.py.