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

Function test_shuffle_slice

dask/array/tests/test_slicing.py:987–1001  ·  view source on GitHub ↗
(size, chunks)

Source from the content-addressed store, hash-verified

985 "size, chunks", [((100, 2), (50, 2)), ((100, 2), (37, 1)), ((100,), (55,))]
986)
987def test_shuffle_slice(size, chunks):
988 x = da.random.default_rng().integers(0, 1000, size=size, chunks=chunks)
989 index = np.arange(len(x))
990 np.random.default_rng().shuffle(index)
991
992 a = x[index]
993 b = shuffle_slice(x, index)
994 assert_eq(a, b)
995
996 index = np.arange(1, len(x)).tolist()
997 index.append(0)
998 index = np.array(index)
999 a = x[index]
1000 b = shuffle_slice(x, index)
1001 assert_eq(a, b)
1002
1003
1004def test_unknown_chunks_length_one():

Callers

nothing calls this directly

Calls 5

shuffle_sliceFunction · 0.90
assert_eqFunction · 0.90
integersMethod · 0.45
arangeMethod · 0.45
shuffleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…