MCPcopy Create free account
hub / github.com/dask/dask / constant

Function constant

dask/array/overlap.py:260–273  ·  view source on GitHub ↗

Add constant slice to either side of array

(x, axis, depth, value)

Source from the content-addressed store, hash-verified

258
259
260def constant(x, axis, depth, value):
261 """Add constant slice to either side of array"""
262 chunks = list(x.chunks)
263 chunks[axis] = (depth,)
264
265 c = full_like(
266 x,
267 value,
268 shape=tuple(map(sum, chunks)),
269 chunks=tuple(chunks),
270 dtype=x.dtype,
271 )
272
273 return concatenate([c, x, c], axis=axis)
274
275
276def _remove_overlap_boundaries(l, r, axis, depth):

Callers 1

boundariesFunction · 0.70

Calls 2

full_likeFunction · 0.90
concatenateFunction · 0.90

Tested by

no test coverage detected