Get new chunks for array with overlap.
(original_chunks, axes)
| 24 | |
| 25 | |
| 26 | def _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 | |
| 50 | def overlap_internal(x, axes): |
no test coverage detected
searching dependent graphs…