MCPcopy Create free account
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:88–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

meta_from_arrayFunction · 0.90

Tested by

no test coverage detected