コード例 #1
0
ファイル: test_compressed.py プロジェクト: sayandip18/sparse
def test_from_coo_valerr(a):
    with pytest.raises(ValueError):
        GCXS.from_coo(a, idx_dtype=np.int8)
コード例 #2
0
ファイル: test_compressed.py プロジェクト: sayandip18/sparse
def test_from_coo(a):
    assert_eq(a, GCXS(a))
コード例 #3
0
ファイル: test_compressed.py プロジェクト: sayandip18/sparse
def test_gcxs_valerr():
    a = np.arange(300)
    with pytest.raises(ValueError):
        GCXS.from_numpy(a, idx_dtype=np.int8)
コード例 #4
0
ファイル: test_compressed.py プロジェクト: sayandip18/sparse
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)
コード例 #5
0
ファイル: test_compressed.py プロジェクト: sayandip18/sparse
def test_tocoo(coo):
    b = GCXS.from_coo(coo)
    assert_eq(b.tocoo(), coo)
コード例 #6
0
def test_tocoo():
    coo = sparse.random((5, 6), density=0.5)
    b = GCXS.from_coo(coo)
    assert_eq(b.tocoo(), coo)