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

Function test_vindex_identity

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

Source from the content-addressed store, hash-verified

3522
3523
3524def test_vindex_identity():
3525 rng = da.random.default_rng(42)
3526 a, b = 10, 20
3527
3528 x = rng.random(a, chunks=a // 2)
3529 assert x is x.vindex[:]
3530 assert x is x.vindex[:a]
3531 pytest.raises(IndexError, lambda: x.vindex[: a - 1])
3532 pytest.raises(IndexError, lambda: x.vindex[1:])
3533 pytest.raises(IndexError, lambda: x.vindex[0:a:2])
3534
3535 x = rng.random((a, b), chunks=(a // 2, b // 2))
3536 assert x is x.vindex[:, :]
3537 assert x is x.vindex[:a, :b]
3538 pytest.raises(IndexError, lambda: x.vindex[:, : b - 1])
3539 pytest.raises(IndexError, lambda: x.vindex[:, 1:])
3540 pytest.raises(IndexError, lambda: x.vindex[:, 0:b:2])
3541
3542
3543def test_empty_array():

Callers

nothing calls this directly

Calls 1

randomMethod · 0.45

Tested by

no test coverage detected