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

Function test_auto_chunks_h5py

dask/array/tests/test_array_core.py:5791–5806  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5789
5790
5791def test_auto_chunks_h5py():
5792 h5py = pytest.importorskip("h5py")
5793
5794 with tmpfile(".hdf5") as fn:
5795 with h5py.File(fn, mode="a") as f:
5796 d = f.create_dataset(
5797 "/x", shape=(1000, 1000), chunks=(32, 64), dtype="float64"
5798 )
5799 d[:] = 1
5800
5801 with h5py.File(fn, mode="a") as f:
5802 d = f["x"]
5803 with dask.config.set({"array.chunk-size": "1 MiB"}):
5804 x = da.from_array(d)
5805 assert isinstance(x._meta, np.ndarray)
5806 assert x.chunks == ((256, 256, 256, 232), (512, 488))
5807
5808
5809def test_no_warnings_from_blockwise():

Callers

nothing calls this directly

Calls 2

tmpfileFunction · 0.90
setMethod · 0.80

Tested by

no test coverage detected