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

Function test_array_cumreduction_ufunc

dask/array/tests/test_reductions.py:691–704  ·  view source on GitHub ↗
(ufunc, target_dtype)

Source from the content-addressed store, hash-verified

689@pytest.mark.parametrize("ufunc", ["add", "multiply", "maximum"])
690@pytest.mark.parametrize("target_dtype", [None, int, float])
691def test_array_cumreduction_ufunc(ufunc, target_dtype):
692 ufunc_obj = getattr(np, ufunc)
693 accumulate = ufunc_obj.accumulate
694 identity = ufunc_obj.identity
695
696 a = np.linspace(0, 1, num=10, dtype=float)
697 d = da.from_array(a)
698
699 cumreduction = da.reductions.cumreduction
700
701 a_r = accumulate(a, dtype=target_dtype)
702 d_r = cumreduction(accumulate, ufunc_obj, identity, d, dtype=target_dtype)
703
704 assert_eq(a_r, d_r)
705
706
707@pytest.mark.parametrize("func", [np.cumsum, np.cumprod])

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
cumreductionFunction · 0.85

Tested by

no test coverage detected