MCPcopy
hub / github.com/dask/dask / periodic

Function periodic

dask/array/overlap.py:180–201  ·  view source on GitHub ↗

Copy a slice of an array around to its other side Useful to create periodic boundary conditions for overlap

(x, axis, depth)

Source from the content-addressed store, hash-verified

178
179
180def periodic(x, axis, depth):
181 """Copy a slice of an array around to its other side
182
183 Useful to create periodic boundary conditions for overlap
184 """
185
186 left = (
187 (slice(None, None, None),) * axis
188 + (slice(0, depth),)
189 + (slice(None, None, None),) * (x.ndim - axis - 1)
190 )
191 right = (
192 (slice(None, None, None),) * axis
193 + (slice(-depth, None),)
194 + (slice(None, None, None),) * (x.ndim - axis - 1)
195 )
196 l = x[left]
197 r = x[right]
198
199 l, r = _remove_overlap_boundaries(l, r, axis, depth)
200
201 return concatenate([r, x, l], axis=axis)
202
203
204def reflect(x, axis, depth):

Callers 1

boundariesFunction · 0.70

Calls 2

concatenateFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…