| 3355 | |
| 3356 | |
| 3357 | def 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 | |
| 3370 | def test_ellipsis_slicing(): |