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:5134–5147  ·  view source on GitHub ↗
(shape, chunks, expect_rechunk)

Source from the content-addressed store, hash-verified

5132 ],
5133)
5134def test_zarr_irregular_chunks(shape, chunks, expect_rechunk):
5135 pytest.importorskip("zarr")
5136 with tmpdir() as d:
5137 a = da.zeros(shape, chunks=chunks) # ((2, 1, 1, 2), 1))
5138 if expect_rechunk:
5139 with pytest.warns(UserWarning, match="The array uses irregular chunk"):
5140 store_delayed = a.to_zarr(d, component="test", compute=False)
5141 else:
5142 store_delayed = a.to_zarr(d, component="test", compute=False)
5143 assert (
5144 any("rechunk" in key_split(k) for k in dict(store_delayed.dask))
5145 is expect_rechunk
5146 )
5147 store_delayed.compute()
5148
5149
5150@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