MCPcopy Index your code
hub / github.com/dask/dask / periodic

Function periodic

dask/array/_array_expr/_overlap.py:194–215  ·  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

192
193
194def periodic(x, axis, depth):
195 """Copy a slice of an array around to its other side
196
197 Useful to create periodic boundary conditions for overlap
198 """
199
200 left = (
201 (slice(None, None, None),) * axis
202 + (slice(0, depth),)
203 + (slice(None, None, None),) * (x.ndim - axis - 1)
204 )
205 right = (
206 (slice(None, None, None),) * axis
207 + (slice(-depth, None),)
208 + (slice(None, None, None),) * (x.ndim - axis - 1)
209 )
210 l = x[left]
211 r = x[right]
212
213 l, r = _remove_overlap_boundaries(l, r, axis, depth)
214
215 return concatenate([r, x, l], axis=axis)
216
217
218def reflect(x, axis, depth):

Callers 2

test_periodicFunction · 0.90
boundariesFunction · 0.70

Calls 2

concatenateFunction · 0.90

Tested by 1

test_periodicFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…