(ufunc, target_dtype)
| 689 | @pytest.mark.parametrize("ufunc", ["add", "multiply", "maximum"]) |
| 690 | @pytest.mark.parametrize("target_dtype", [None, int, float]) |
| 691 | def 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]) |
nothing calls this directly
no test coverage detected