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

Function test_basic

dask/array/tests/test_sparse.py:79–93  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

77
78@pytest.mark.parametrize("func", functions)
79def test_basic(func):
80 x = da.random.random((2, 3, 4), chunks=(1, 2, 2))
81 x[x < 0.8] = 0
82
83 y = x.map_blocks(sparse.COO.from_numpy)
84
85 xx = func(x)
86 yy = func(y)
87
88 assert_eq(xx, yy, check_meta=False)
89
90 if yy.shape:
91 zz = yy.compute()
92 if not isinstance(zz, sparse.COO):
93 assert (zz != 1).sum() > np.prod(zz.shape) / 2 # mostly dense
94
95
96def test_tensordot():

Callers

nothing calls this directly

Calls 7

assert_eqFunction · 0.90
funcFunction · 0.70
randomMethod · 0.45
map_blocksMethod · 0.45
computeMethod · 0.45
sumMethod · 0.45
prodMethod · 0.45

Tested by

no test coverage detected