MCPcopy
hub / github.com/dask/dask / test_mixed_random

Function test_mixed_random

dask/array/tests/test_masked.py:146–156  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

144@pytest.mark.parametrize("func", functions)
145@pytest.mark.filterwarnings(f"ignore::{typename(ComplexWarning)}") # abs() in assert_eq
146def test_mixed_random(func):
147 d = da.random.default_rng().random((4, 3, 4), chunks=(1, 2, 2))
148 d[d < 0.4] = 0
149
150 fn = lambda x: np.ma.masked_equal(x, 0) if random.random() < 0.5 else x
151 s = d.map_blocks(fn)
152
153 dd = func(d)
154 ss = func(s)
155
156 assert_eq(dd, ss, check_meta=False, check_type=False)
157
158
159def test_mixed_output_type():

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
funcFunction · 0.70
randomMethod · 0.45
map_blocksMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…