MCPcopy
hub / github.com/dask/dask / test_meta_from_array_scipy_sparse

Function test_meta_from_array_scipy_sparse

dask/array/tests/test_array_utils.py:87–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85
86
87def test_meta_from_array_scipy_sparse():
88 pytest.importorskip("scipy.sparse")
89 import scipy.sparse
90
91 # Note: csr_matrix can exclusively have ndim=2
92 x = scipy.sparse.csr_matrix([[2, 3]])
93 meta = meta_from_array(x)
94 assert isinstance(meta, type(x))
95
96 meta = meta_from_array(x, ndim=2)
97 assert isinstance(meta, type(x))
98 assert meta.shape == (0, 0)
99
100 meta = meta_from_array(x, dtype=np.float32)
101 assert isinstance(meta, type(x))
102 assert meta.dtype == np.float32
103
104
105@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

meta_from_arrayFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…