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

Function boundaries

dask/array/overlap.py:286–316  ·  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

284
285
286def boundaries(x, depth=None, kind=None):
287 """Add boundary conditions to an array before overlapping
288
289 See Also
290 --------
291 periodic
292 constant
293 """
294 if not isinstance(kind, dict):
295 kind = dict.fromkeys(range(x.ndim), kind)
296 if not isinstance(depth, dict):
297 depth = dict.fromkeys(range(x.ndim), depth)
298
299 for i in range(x.ndim):
300 d = depth.get(i, 0)
301 if d == 0:
302 continue
303
304 this_kind = kind.get(i, "none")
305 if this_kind == "none":
306 continue
307 elif this_kind == "periodic":
308 x = periodic(x, i, d)
309 elif this_kind == "reflect":
310 x = reflect(x, i, d)
311 elif this_kind == "nearest":
312 x = nearest(x, i, d)
313 elif i in kind:
314 x = constant(x, i, d, kind[i])
315
316 return x
317
318
319def ensure_minimum_chunksize(size, chunks):

Callers 1

overlapFunction · 0.70

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…