def test_change_compressed_axes(): coo = sparse.random((3, 4, 5), density=0.5) 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)
def test_from_coo_valerr(): a = sparse.random((25, 25, 25), density=0.01, format="coo") with pytest.raises(ValueError): GCXS.from_coo(a, idx_dtype=np.int8)
def test_tocoo(): coo = sparse.random((5, 6), density=0.5) b = GCXS.from_coo(coo) assert_eq(b.tocoo(), coo)
def test_from_coo_valerr(a): with pytest.raises(ValueError): GCXS.from_coo(a, idx_dtype=np.int8)
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)
def test_tocoo(coo): b = GCXS.from_coo(coo) assert_eq(b.tocoo(), coo)