diff --git a/gridlock/test/test_grid.py b/gridlock/test/test_grid.py index c6c8ae7..2cb60c5 100644 --- a/gridlock/test/test_grid.py +++ b/gridlock/test/test_grid.py @@ -240,6 +240,14 @@ def test_get_slice_uses_shifted_grid_bounds() -> None: +def test_sampled_preview_exyz_tracks_nonuniform_centers() -> None: + grid = Grid([[0, 1, 3, 6, 10], [0, 1, 2], [0, 1, 2]], shifts=[[0, 0, 0]]) + + sampled_exyz = grid._sampled_exyz(0, 2) + + assert_allclose(sampled_exyz[0], [-1.5, 2.5, 6.5]) + + def test_visualize_isosurface_sampling_uses_preview_lattice(monkeypatch: pytest.MonkeyPatch) -> None: matplotlib = pytest.importorskip('matplotlib') matplotlib.use('Agg')