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

Function test_arg_reductions

dask/array/tests/test_masked.py:289–301  ·  view source on GitHub ↗
(reduction)

Source from the content-addressed store, hash-verified

287
288@pytest.mark.parametrize("reduction", ["argmin", "argmax"])
289def 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
304def test_cumulative():

Callers

nothing calls this directly

Calls 3

assert_eq_maFunction · 0.85
funcFunction · 0.70
randomMethod · 0.45

Tested by

no test coverage detected