MCPcopy
hub / github.com/dask/dask / test_map_overlap_multiarray_variadic

Function test_map_overlap_multiarray_variadic

dask/array/tests/test_overlap.py:484–509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

482
483@pytest.mark.xfail(da._array_expr_enabled(), reason="__array_function__ needed")
484def test_map_overlap_multiarray_variadic():
485 # Test overlapping row slices from 3D arrays
486 xs = [
487 # Dim 0 will unify to chunks of size 4 for all:
488 da.ones((12, 1, 1), chunks=((12,), 1, 1)),
489 da.ones((12, 8, 1), chunks=((8, 4), 8, 1)),
490 da.ones((12, 8, 4), chunks=((4, 8), 8, 4)),
491 ]
492
493 def func(*args):
494 return np.array([sum(x.size for x in args)])
495
496 x = da.map_overlap(
497 func,
498 *xs,
499 chunks=(1,),
500 depth=1,
501 trim=False,
502 drop_axis=[1, 2],
503 boundary="reflect",
504 )
505
506 # Each func call should get 4 rows from each array padded by 1 in each dimension
507 size_per_slice = sum(np.pad(x[:4], 1, mode="constant").size for x in xs)
508 assert x.shape == (3,)
509 assert all(x.compute() == size_per_slice)
510
511
512@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

allFunction · 0.85
sumFunction · 0.50
onesMethod · 0.45
map_overlapMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…