From 9e4492f6f0dc148441e833fc93282f6ee9255f3f Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Tue, 19 Mar 2024 12:48:08 +0200 Subject: [PATCH] Test stacking via the use of xarray.Dataset.expand_dims --- tests/test_xarrayfits.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_xarrayfits.py b/tests/test_xarrayfits.py index 848d89a..cf832af 100644 --- a/tests/test_xarrayfits.py +++ b/tests/test_xarrayfits.py @@ -47,6 +47,10 @@ def test_globbing(multiple_files): combined.hdu0.data, np.concatenate([expected] * 3, axis=1) ) + tds = [ds.expand_dims(dim="time", axis=0) for ds in datasets] + combined = xarray.concat(tds, dim="time") + np.testing.assert_array_equal(combined.hdu0.data, np.stack([expected] * 3, axis=0)) + @pytest.fixture(scope="session") def beam_cube(tmp_path_factory):