(reduction)
| 287 | |
| 288 | @pytest.mark.parametrize("reduction", ["argmin", "argmax"]) |
| 289 | def test_arg_reductions(reduction): |
| 290 | x = np.random.default_rng().random((10, 10, 10)) |
| 291 | dx = da.from_array(x, chunks=(3, 4, 5)) |
| 292 | mx = np.ma.masked_greater(x, 0.4) |
| 293 | dmx = da.ma.masked_greater(dx, 0.4) |
| 294 | |
| 295 | dfunc = getattr(da, reduction) |
| 296 | func = getattr(np, reduction) |
| 297 | |
| 298 | assert_eq_ma(dfunc(dmx), func(mx)) |
| 299 | assert_eq_ma(dfunc(dmx, 0), func(mx, 0)) |
| 300 | assert_eq_ma(dfunc(dmx, 1), func(mx, 1)) |
| 301 | assert_eq_ma(dfunc(dmx, 2), func(mx, 2)) |
| 302 | |
| 303 | |
| 304 | def test_cumulative(): |
nothing calls this directly
no test coverage detected