MCPcopy
hub / github.com/dask/dask / _breakpoints

Function _breakpoints

dask/array/rechunk.py:46–57  ·  view source on GitHub ↗

>>> new = cumdims_label(((2, 3), (2, 2, 1)), 'n') >>> old = cumdims_label(((2, 2, 1), (5,)), 'o') >>> _breakpoints(new[0], old[0]) (('n', 0), ('o', 0), ('n', 2), ('o', 2), ('o', 4), ('n', 5), ('o', 5)) >>> _breakpoints(new[1], old[1]) (('n', 0), ('o', 0), ('n', 2), ('n', 4

(cumold, cumnew)

Source from the content-addressed store, hash-verified

44
45
46def _breakpoints(cumold, cumnew):
47 """
48
49 >>> new = cumdims_label(((2, 3), (2, 2, 1)), 'n')
50 >>> old = cumdims_label(((2, 2, 1), (5,)), 'o')
51
52 >>> _breakpoints(new[0], old[0])
53 (('n', 0), ('o', 0), ('n', 2), ('o', 2), ('o', 4), ('n', 5), ('o', 5))
54 >>> _breakpoints(new[1], old[1])
55 (('n', 0), ('o', 0), ('n', 2), ('n', 4), ('n', 5), ('o', 5))
56 """
57 return tuple(sorted(cumold + cumnew, key=itemgetter(1)))
58
59
60def _intersect_1d(breaks):

Callers 2

test_rechunk_internals_1Function · 0.90
old_to_newFunction · 0.85

Calls 1

itemgetterClass · 0.85

Tested by 1

test_rechunk_internals_1Function · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…