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

Function test_set_fill_value

dask/array/tests/test_masked.py:357–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355
356
357def test_set_fill_value():
358 x = np.random.default_rng().integers(0, 10, (10, 10))
359 dx = da.from_array(x, chunks=(3, 4))
360 mx = np.ma.masked_greater(x, 3)
361 dmx = da.ma.masked_greater(dx, 3)
362
363 da.ma.set_fill_value(dmx, -10)
364 np.ma.set_fill_value(mx, -10)
365 assert_eq_ma(dmx, mx)
366
367 da.ma.set_fill_value(dx, -10)
368 np.ma.set_fill_value(x, -10)
369 assert_eq_ma(dx, x)
370
371 with pytest.raises(TypeError):
372 da.ma.set_fill_value(dmx, 1e20)
373
374 with pytest.raises(ValueError):
375 da.ma.set_fill_value(dmx, dx)
376
377
378@pytest.mark.parametrize("keepdims", [False, True])

Callers

nothing calls this directly

Calls 2

assert_eq_maFunction · 0.85
integersMethod · 0.45

Tested by

no test coverage detected