Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_check_is_scipy_sparse_array():
t_csr = scipy.sparse.csr_matrix([0])
t_csc = scipy.sparse.csc_matrix([0])
t_bsr = scipy.sparse.bsr_matrix([0])
assert check_is_scipy_sparse_array(t_csr) is True
assert check_is_scipy_sparse_array(t_csc) is True
assert check_is_scipy_sparse_array(t_bsr) is True
assert check_is_scipy_sparse_array(np.array([1])) is False
def test_is_sparse():
sm0 = csr_matrix((3, 4), dtype=np.int8)
sm1 = csc_matrix((1, 2))
assert check_is_scipy_sparse_array(sm0)
assert check_is_scipy_sparse_array(sm1)
def test_check_is_scipy_sparse_array():
t_csr = scipy.sparse.csr_matrix([0])
t_csc = scipy.sparse.csc_matrix([0])
t_bsr = scipy.sparse.bsr_matrix([0])
assert check_is_scipy_sparse_array(t_csr) is True
assert check_is_scipy_sparse_array(t_csc) is True
assert check_is_scipy_sparse_array(t_bsr) is True
assert check_is_scipy_sparse_array(np.array([1])) is False
def test_is_sparse():
sm0 = csr_matrix((3, 4), dtype=np.int8)
sm1 = csc_matrix((1, 2))
assert check_is_scipy_sparse_array(sm0)
assert check_is_scipy_sparse_array(sm1)
def test_check_is_scipy_sparse_array():
t_csr = scipy.sparse.csr_matrix([0])
t_csc = scipy.sparse.csc_matrix([0])
t_bsr = scipy.sparse.bsr_matrix([0])
assert check_is_scipy_sparse_array(t_csr) is True
assert check_is_scipy_sparse_array(t_csc) is True
assert check_is_scipy_sparse_array(t_bsr) is True
assert check_is_scipy_sparse_array(np.array([1])) is False
def test_check_is_scipy_sparse_array():
t_csr = scipy.sparse.csr_matrix([0])
t_csc = scipy.sparse.csc_matrix([0])
t_bsr = scipy.sparse.bsr_matrix([0])
assert check_is_scipy_sparse_array(t_csr) is True
assert check_is_scipy_sparse_array(t_csc) is True
assert check_is_scipy_sparse_array(t_bsr) is True
assert check_is_scipy_sparse_array(np.array([1])) is False