From daa9ee760328395c97a3c6ea018a896c996f7ae8 Mon Sep 17 00:00:00 2001 From: mloubout Date: Mon, 1 Jul 2024 09:59:13 -0400 Subject: [PATCH] CI: add single mpi sparse test --- tests/test_data.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_data.py b/tests/test_data.py index 47c1c78d169..3f4d0b5cb96 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -208,6 +208,17 @@ def test_indexing_into_sparse(self): sf.data[1:-1, 0] = np.arange(8) assert np.all(sf.data[1:-1, 0] == np.arange(8)) + @pytest.mark.parallel(mode=1) + def test_indexing_into_sparse_subfunc_singlempi(self, mode): + grid = Grid(shape=(4, 4)) + s = SparseFunction(name='sf', grid=grid, npoint=1) + coords = np.random.rand(*s.coordinates.data.shape) + s.coordinates.data[:] = coords + + s.coordinates.data[-1, :] = s.coordinates.data[-1, :] / 2 + + assert np.allclose(s.coordinates.data[-1, :], coords[-1, :] / 2) + class TestLocDataIDX: """