def test_resource_existing_carray(): with tmpfile('.bcolz') as fn: r = resource(fn, dshape='var * int32') append(r, [1, 2, 3]) r.flush() newr = resource(fn) assert isinstance(newr, carray)
def test_resource_existing_carray(): with tmpfile('.bcolz') as fn: os.remove(fn) r = resource(fn, dshape=discover(y)) append(r, y) r.flush() r2 = resource(fn) assert eq(r2[:], y)
def test_append_other(): b = carray(x) append(b, convert(list, x)) assert len(b) == 2 * len(x)
def test_append_chunks(): b = carray(x) append(b, chunks(np.ndarray)([x, x])) assert len(b) == len(x) * 3
def test_resource_existing_carray(): with tmpbcolz(dshape='var * int32') as r: append(r, [1, 2, 3]) r.flush() newr = resource(r.rootdir) assert isinstance(newr, carray)