def test_chunks(): c = convert(chunks(np.ndarray), a, chunksize=2) assert isinstance(c, chunks(np.ndarray)) assert len(list(c)) == 2 assert eq(list(c)[1], [3, 4]) assert eq(convert(np.ndarray, c), a[:])
def test_append_other(): b = carray(x) append(b, convert(list, x)) assert len(b) == 2 * len(x)
def test_convert(): assert isinstance(convert(carray, np.ones([1, 2, 3])), carray) b = carray([1, 2, 3]) assert isinstance(convert(np.ndarray, b), np.ndarray)
def test_convert_numpy_to_ctable(): b = convert(ctable, y) assert isinstance(b, ctable) assert eq(b[:], y)