def test01b(self): """vtable from a collection of differently sized btables""" N = int(1e1) t1 = blz.fromiter(((i, i*2.) for i in xrange(N+1)), dtype='i4,f8', count=N+1, rootdir=self.rootdir) t2 = blz.fromiter(((i, i*2.) for i in xrange(N+1, N*2)), dtype='i4,f8', count=N-1, rootdir=self.rootdir) vt = blz.vtable((t1, t2), rootdir=self.rootdir) ra = np.fromiter(((i, i*2.) for i in xrange(N*2)), dtype='i4,f8') assert_array_equal(vt[:], ra, "vtable values are not correct")
def test00(self): """Testing vtable creation from a tuple of btables (single row)""" N = int(1e1) t1 = blz.fromiter(((i, i*2.) for i in xrange(N)), dtype='i4,f8', count=N, rootdir=self.rootdir) t2 = blz.fromiter(((i, i*3.) for i in xrange(N*2)), dtype='i4,f8', count=N*2, rootdir=self.rootdir) vt = blz.vtable((t1, t2), rootdir=self.rootdir) r = np.array([(1, 3.)], dtype='i4,f8')[0] assert_array_equal(vt[N+1], r, "vtable values are not correct")
def test02a(self): """vtable with start""" N = int(1e1) t1 = blz.fromiter(((i, i*2.) for i in xrange(N+1)), dtype='i4,f8', count=N+1, rootdir=self.rootdir) t2 = blz.fromiter(((i, i*2.) for i in xrange(N+1, N*2)), dtype='i4,f8', count=N-1, rootdir=self.rootdir) t3 = blz.fromiter(((i, i*2.) for i in xrange(N*2, N*3)), dtype='i4,f8', count=N, rootdir=self.rootdir) vt = blz.vtable((t1, t2, t3), rootdir=self.rootdir) ra = np.fromiter(((i, i*2.) for i in xrange(N*3)), dtype='i4,f8') assert_array_equal(vt[2:], ra[2:], "vtable values are not correct")