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

Function test_array_function_sparse

dask/array/tests/test_array_function.py:102–110  ·  view source on GitHub ↗
(xfail, func)

Source from the content-addressed store, hash-verified

100
101@pytest.mark.parametrize("func", [np.real, np.imag, np.transpose])
102def test_array_function_sparse(xfail, func):
103 sparse = pytest.importorskip("sparse")
104 if Version(sparse.__version__) == Version("0.15.2") and func in (np.real, np.imag):
105 xfail(reason="https://github.com/pydata/sparse/issues/682")
106
107 x = da.random.default_rng().random((500, 500), chunks=(100, 100))
108 x[x < 0.9] = 0
109 y = x.map_blocks(sparse.COO)
110 assert_eq(func(x), func(y))
111
112
113def test_array_function_sparse_tensordot():

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected