dask 2021.10.0

ParametersBackRef
overlap(x, depth, boundary)

Parameters

x: da.Array :

A dask array

depth: dict :

The size of the shared boundary per axis

boundary: dict :

The boundary condition on each axis. Options are 'reflect', 'periodic', 'nearest', 'none', or an array value. Such a value will fill the boundary with that value.

The depth input informs how many cells to overlap between neighboring :
blocks ``{0: 2, 2: 5}`` means share two cells in 0 axis, 5 cells in 2 axis. :
Axes missing from this input will not be overlapped. :
Any axis containing chunks smaller than depth will be rechunked if :
possible. :

Share boundaries between neighboring blocks

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy as np
... import dask.array as da
This example is valid syntax, but we were not able to check execution
>>> x = np.arange(64).reshape((8, 8))
... d = da.from_array(x, chunks=(4, 4))
... d.chunks ((4, 4), (4, 4))
This example is valid syntax, but we were not able to check execution
>>> g = da.overlap.overlap(d, depth={0: 2, 1: 1},
...  boundary={0: 100, 1: 'reflect'})
... g.chunks ((8, 8), (6, 6))
This example is valid syntax, but we were not able to check execution
>>> np.array(g)
array([[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
       [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
       [  0,   0,   1,   2,   3,   4,   3,   4,   5,   6,   7,   7],
       [  8,   8,   9,  10,  11,  12,  11,  12,  13,  14,  15,  15],
       [ 16,  16,  17,  18,  19,  20,  19,  20,  21,  22,  23,  23],
       [ 24,  24,  25,  26,  27,  28,  27,  28,  29,  30,  31,  31],
       [ 32,  32,  33,  34,  35,  36,  35,  36,  37,  38,  39,  39],
       [ 40,  40,  41,  42,  43,  44,  43,  44,  45,  46,  47,  47],
       [ 16,  16,  17,  18,  19,  20,  19,  20,  21,  22,  23,  23],
       [ 24,  24,  25,  26,  27,  28,  27,  28,  29,  30,  31,  31],
       [ 32,  32,  33,  34,  35,  36,  35,  36,  37,  38,  39,  39],
       [ 40,  40,  41,  42,  43,  44,  43,  44,  45,  46,  47,  47],
       [ 48,  48,  49,  50,  51,  52,  51,  52,  53,  54,  55,  55],
       [ 56,  56,  57,  58,  59,  60,  59,  60,  61,  62,  63,  63],
       [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
       [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.overlap.overlap

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/overlap.py#361
type: <class 'function'>
Commit: