Exemple #1
0
def test_from_coo_valerr(a):
    with pytest.raises(ValueError):
        GCXS.from_coo(a, idx_dtype=np.int8)
Exemple #2
0
def test_from_coo(a):
    assert_eq(a, GCXS(a))
Exemple #3
0
def test_gcxs_valerr():
    a = np.arange(300)
    with pytest.raises(ValueError):
        GCXS.from_numpy(a, idx_dtype=np.int8)
Exemple #4
0
def test_change_compressed_axes(coo):
    s = GCXS.from_coo(coo, compressed_axes=(0, 1))
    b = GCXS.from_coo(coo, compressed_axes=(1, 2))
    assert_eq(s, b)
    s.change_compressed_axes((1, 2))
    assert_eq(s, b)
Exemple #5
0
def test_tocoo(coo):
    b = GCXS.from_coo(coo)
    assert_eq(b.tocoo(), coo)
Exemple #6
0
def test_tocoo():
    coo = sparse.random((5, 6), density=0.5)
    b = GCXS.from_coo(coo)
    assert_eq(b.tocoo(), coo)