MCPcopy Index your code
hub / github.com/dask/dask / test_asarray_h5py

Function test_asarray_h5py

dask/array/tests/test_array_core.py:3100–3111  ·  view source on GitHub ↗
(asarray, inline_array)

Source from the content-addressed store, hash-verified

3098@pytest.mark.parametrize("asarray", [da.asarray, da.asanyarray])
3099@pytest.mark.parametrize("inline_array", [True, False])
3100def test_asarray_h5py(asarray, inline_array):
3101 h5py = pytest.importorskip("h5py")
3102
3103 with tmpfile(".hdf5") as fn:
3104 with h5py.File(fn, mode="a") as f:
3105 d = f.create_dataset("/x", shape=(2, 2), dtype=float)
3106 x = asarray(d, inline_array=inline_array)
3107
3108 # Check for the array in the dsk
3109 dsk = dict(x.dask)
3110 assert (d in dsk.values()) is not inline_array
3111 assert not any(isinstance(v, np.ndarray) for v in dsk.values())
3112
3113
3114def test_asarray_chunks():

Callers

nothing calls this directly

Calls 4

tmpfileFunction · 0.90
anyFunction · 0.85
asarrayFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…