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

Function _overlap_internal_chunks

dask/array/overlap.py:26–47  ·  view source on GitHub ↗

Get new chunks for array with overlap.

(original_chunks, axes)

Source from the content-addressed store, hash-verified

24
25
26def _overlap_internal_chunks(original_chunks, axes):
27 """Get new chunks for array with overlap."""
28 chunks = []
29 for i, bds in enumerate(original_chunks):
30 depth = axes.get(i, 0)
31 if isinstance(depth, tuple):
32 left_depth = depth[0]
33 right_depth = depth[1]
34 else:
35 left_depth = depth
36 right_depth = depth
37
38 if len(bds) == 1:
39 chunks.append(bds)
40 else:
41 left = [bds[0] + right_depth]
42 right = [bds[-1] + left_depth]
43 mid = []
44 for bd in bds[1:-1]:
45 mid.append(bd + left_depth + right_depth)
46 chunks.append(left + mid + right)
47 return chunks
48
49
50def overlap_internal(x, axes):

Callers 1

overlap_internalFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…