MCPcopy
hub / github.com/dask/dask / test_array_slice_deps

Function test_array_slice_deps

dask/tests/test_layers.py:55–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54
55def test_array_slice_deps():
56 pytest.importorskip("numpy")
57 dac = pytest.importorskip("dask.array.core")
58 d = 2 # number of chunks in x,y
59 chunk = (2, 3) # chunk shape
60 shape = tuple(d * n for n in chunk) # array shape
61 chunks = dac.normalize_chunks(chunk, shape)
62 array_deps = ArraySliceDep(chunks)
63
64 def check(i, j):
65 slices = array_deps[(i, j)]
66 assert slices == (
67 slice(chunk[0] * i, chunk[0] * (i + 1), None),
68 slice(chunk[1] * j, chunk[1] * (j + 1), None),
69 )
70
71 for i in range(d):
72 for j in range(d):
73 check(i, j)
74
75
76def _dataframe_shuffle(tmpdir):

Callers

nothing calls this directly

Calls 2

ArraySliceDepClass · 0.90
checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…