Share boundaries between neighboring blocks Parameters ---------- x: da.Array A dask array axes: dict The size of the shared boundary per axis The axes input informs how many cells to overlap between neighboring blocks {0: 2, 2: 5} means share two cells in
(x, axes)
| 48 | |
| 49 | |
| 50 | def overlap_internal(x, axes): |
| 51 | """Share boundaries between neighboring blocks |
| 52 | |
| 53 | Parameters |
| 54 | ---------- |
| 55 | |
| 56 | x: da.Array |
| 57 | A dask array |
| 58 | axes: dict |
| 59 | The size of the shared boundary per axis |
| 60 | |
| 61 | The axes input informs how many cells to overlap between neighboring blocks |
| 62 | {0: 2, 2: 5} means share two cells in 0 axis, 5 cells in 2 axis |
| 63 | """ |
| 64 | token = tokenize(x, axes) |
| 65 | name = f"overlap-{token}" |
| 66 | |
| 67 | graph = ArrayOverlapLayer( |
| 68 | name=x.name, |
| 69 | axes=axes, |
| 70 | chunks=x.chunks, |
| 71 | numblocks=x.numblocks, |
| 72 | token=token, |
| 73 | ) |
| 74 | graph = HighLevelGraph.from_collections(name, graph, dependencies=[x]) |
| 75 | chunks = _overlap_internal_chunks(x.chunks, axes) |
| 76 | |
| 77 | return Array(graph, name, chunks, meta=x) |
| 78 | |
| 79 | |
| 80 | def trim_overlap(x, depth, boundary=None): |
no test coverage detected
searching dependent graphs…