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

Function test_count_nonzero_obj

dask/array/tests/test_routines.py:2053–2063  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2051
2052
2053def test_count_nonzero_obj():
2054 x = np.random.default_rng().integers(10, size=(15, 16)).astype(object)
2055 d = da.from_array(x, chunks=(4, 5))
2056
2057 x_c = np.count_nonzero(x)
2058 d_c = da.count_nonzero(d)
2059
2060 if d_c.shape == tuple():
2061 assert x_c == d_c.compute()
2062 else:
2063 assert_eq(x_c, d_c)
2064
2065
2066@pytest.mark.parametrize("axis", [None, 0, (1,), (0, 1)])

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
astypeMethod · 0.45
integersMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected