From f4efdfe1e6548d21aabdac02afdf21062e8fb36d Mon Sep 17 00:00:00 2001 From: Alister Trabattoni Date: Tue, 17 Sep 2024 20:05:05 +0200 Subject: [PATCH] Ensure chunks are ordered in TestIO.generate when testing xdas.dask.core. --- tests/dask/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dask/test_core.py b/tests/dask/test_core.py index dd65b52..34c8b4a 100644 --- a/tests/dask/test_core.py +++ b/tests/dask/test_core.py @@ -59,7 +59,7 @@ def generate(self, tmpdir): chunks = np.split(expected, 5, axis=1) for idx, chunk in enumerate(chunks): np.save(os.path.join(tmpdir, f"chunk_{idx}.npy"), chunk) - paths = glob(os.path.join(tmpdir, "*.npy")) + paths = sorted(glob(os.path.join(tmpdir, "*.npy"))) chunks = [dask.delayed(np.load)(path) for path in paths] chunks = [ dask.array.from_delayed(chunk, shape=(3, 2), dtype=expected.dtype)