MCPcopy Index your code
hub / github.com/dask/dask / test_two

Function test_two

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

Source from the content-addressed store, hash-verified

88 ],
89)
90def test_two(kind, kwargs):
91 # The sums of observed and expected frequencies must match
92 a = np.random.random(size=30)
93 b = a[::-1]
94
95 a_ = da.from_array(a, 3)
96 b_ = da.from_array(b, 3)
97
98 dask_test = getattr(dask.array.stats, kind)
99 scipy_test = getattr(scipy.stats, kind)
100
101 with warnings.catch_warnings(): # maybe overflow warning (power_divergence)
102 warnings.simplefilter("ignore", category=RuntimeWarning)
103 result = dask_test(a_, b_, **kwargs)
104 expected = scipy_test(a, b, **kwargs)
105
106 assert isinstance(result, Delayed)
107 assert allclose(result.compute(), expected)
108 # fails occasionally. shouldn't this be exact?
109 # assert dask.compute(*result) == expected
110
111
112@pytest.mark.parametrize("k", range(5))

Callers

nothing calls this directly

Calls 3

allcloseFunction · 0.90
randomMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…