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

Function test_numel

dask/array/tests/test_sparse.py:182–191  ·  view source on GitHub ↗
(numel, axis, keepdims)

Source from the content-addressed store, hash-verified

180@pytest.mark.parametrize("axis", [0, (0, 1), None])
181@pytest.mark.parametrize("keepdims", [True, False])
182def test_numel(numel, axis, keepdims):
183 x = np.random.random((2, 3, 4))
184 x[x < 0.8] = 0
185 x[x > 0.9] = np.nan
186
187 xs = sparse.COO.from_numpy(x, fill_value=0.0)
188
189 assert_eq(
190 numel(x, axis=axis, keepdims=keepdims), numel(xs, axis=axis, keepdims=keepdims)
191 )

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
numelFunction · 0.90
randomMethod · 0.45

Tested by

no test coverage detected