MCPcopy Create free account
hub / github.com/dask/dask / test_zarr_irregular_chunks

Function test_zarr_irregular_chunks

dask/array/tests/test_array_core.py:5113–5126  ·  view source on GitHub ↗
(shape, chunks, expect_rechunk)

Source from the content-addressed store, hash-verified

5111 ],
5112)
5113def test_zarr_irregular_chunks(shape, chunks, expect_rechunk):
5114 pytest.importorskip("zarr")
5115 with tmpdir() as d:
5116 a = da.zeros(shape, chunks=chunks) # ((2, 1, 1, 2), 1))
5117 if expect_rechunk:
5118 with pytest.warns(UserWarning, match="The array uses irregular chunk"):
5119 store_delayed = a.to_zarr(d, component="test", compute=False)
5120 else:
5121 store_delayed = a.to_zarr(d, component="test", compute=False)
5122 assert (
5123 any("rechunk" in key_split(k) for k in dict(store_delayed.dask))
5124 is expect_rechunk
5125 )
5126 store_delayed.compute()
5127
5128
5129@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 6

tmpdirFunction · 0.90
key_splitFunction · 0.90
anyFunction · 0.85
to_zarrMethod · 0.80
zerosMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected