From 8895b06f08df4fb43f5910cd29468f32db8866ff Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 20 Apr 2026 10:51:59 -0700 Subject: [PATCH] fixup! [isosurface] fix sampling --- gridlock/test/test_grid.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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')