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

Function test_measures

dask/array/tests/test_stats.py:21–37  ·  view source on GitHub ↗
(kind, kwargs, single_dim)

Source from the content-addressed store, hash-verified

19)
20@pytest.mark.parametrize("single_dim", [True, False])
21def test_measures(kind, kwargs, single_dim):
22 np.random.seed(seed=1337)
23 if single_dim:
24 x = np.random.random(size=(30,))
25 else:
26 x = np.random.random(size=(30, 2))
27 y = da.from_array(x, 3)
28 dfunc = getattr(dask.array.stats, kind)
29 sfunc = getattr(scipy.stats, kind)
30
31 expected = sfunc(x, **kwargs)
32 result = dfunc(y, **kwargs)
33 if np.isscalar(expected):
34 # make it an array to account for possible numeric errors
35 expected = np.array(expected)
36 assert_eq(result, expected)
37 assert isinstance(result, da.Array)
38
39
40def test_bias_raises():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
seedMethod · 0.45
randomMethod · 0.45

Tested by

no test coverage detected