MCPcopy
hub / github.com/dask/dask / boundaries

Function boundaries

dask/array/_array_expr/_overlap.py:300–330  ·  view source on GitHub ↗

Add boundary conditions to an array before overlapping See Also -------- periodic constant

(x, depth=None, kind=None)

Source from the content-addressed store, hash-verified

298
299
300def boundaries(x, depth=None, kind=None):
301 """Add boundary conditions to an array before overlapping
302
303 See Also
304 --------
305 periodic
306 constant
307 """
308 if not isinstance(kind, dict):
309 kind = dict.fromkeys(range(x.ndim), kind)
310 if not isinstance(depth, dict):
311 depth = dict.fromkeys(range(x.ndim), depth)
312
313 for i in range(x.ndim):
314 d = depth.get(i, 0)
315 if d == 0:
316 continue
317
318 this_kind = kind.get(i, "none")
319 if this_kind == "none":
320 continue
321 elif this_kind == "periodic":
322 x = periodic(x, i, d)
323 elif this_kind == "reflect":
324 x = reflect(x, i, d)
325 elif this_kind == "nearest":
326 x = nearest(x, i, d)
327 elif i in kind:
328 x = constant(x, i, d, kind[i])
329
330 return x
331
332
333def ensure_minimum_chunksize(size, chunks):

Callers 4

test_boundariesFunction · 0.90
test_constant_boundariesFunction · 0.90
test_none_boundariesFunction · 0.90
overlapFunction · 0.70

Calls 5

periodicFunction · 0.70
reflectFunction · 0.70
nearestFunction · 0.70
constantFunction · 0.70
getMethod · 0.45

Tested by 3

test_boundariesFunction · 0.72
test_constant_boundariesFunction · 0.72
test_none_boundariesFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…