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

Function test_h5py_newaxis

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

Source from the content-addressed store, hash-verified

3355
3356
3357def test_h5py_newaxis():
3358 h5py = pytest.importorskip("h5py")
3359
3360 with tmpfile("h5") as fn:
3361 with h5py.File(fn, mode="a") as f:
3362 x = f.create_dataset("/x", shape=(10, 10), dtype="f8")
3363 d = da.from_array(x, chunks=(5, 5))
3364 assert d[None, :, :].compute(scheduler="sync").shape == (1, 10, 10)
3365 assert d[:, None, :].compute(scheduler="sync").shape == (10, 1, 10)
3366 assert d[:, :, None].compute(scheduler="sync").shape == (10, 10, 1)
3367 assert same_keys(d[:, :, None], d[:, :, None])
3368
3369
3370def test_ellipsis_slicing():

Callers

nothing calls this directly

Calls 3

tmpfileFunction · 0.90
same_keysFunction · 0.90
computeMethod · 0.45

Tested by

no test coverage detected