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

Function test_asarray_h5py

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

Source from the content-addressed store, hash-verified

3091@pytest.mark.parametrize("asarray", [da.asarray, da.asanyarray])
3092@pytest.mark.parametrize("inline_array", [True, False])
3093def test_asarray_h5py(asarray, inline_array):
3094 h5py = pytest.importorskip("h5py")
3095
3096 with tmpfile(".hdf5") as fn:
3097 with h5py.File(fn, mode="a") as f:
3098 d = f.create_dataset("/x", shape=(2, 2), dtype=float)
3099 x = asarray(d, inline_array=inline_array)
3100
3101 # Check for the array in the dsk
3102 dsk = dict(x.dask)
3103 assert (d in dsk.values()) is not inline_array
3104 assert not any(isinstance(v, np.ndarray) for v in dsk.values())
3105
3106
3107def 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