Example #1
0
 def test_10d_decompress_64(self):
     self.case = "decompress 64"
     pre_trans = self.data.view(np.float64)
     self.data = ext.compress_lz4(pre_trans, BLOCK)
     self.fun = lambda x: ext.decompress_lz4(x, pre_trans.shape,
                                             pre_trans.dtype, BLOCK)
     self.check_data = pre_trans
Example #2
0
 def test_10d_decompress_64(self):
     self.case = "decompress 64"
     pre_trans = self.data.view(np.float64)
     self.data = ext.compress_lz4(pre_trans, BLOCK)
     self.fun = lambda x: ext.decompress_lz4(x, pre_trans.shape, pre_trans.
                                             dtype, BLOCK)
     self.check_data = pre_trans
Example #3
0
 def test_circle_with_compression(self):
     nmax = 100000
     reps = 20
     for dtype in TEST_DTYPES:
         itemsize = np.dtype(dtype).itemsize
         nbyte_max = nmax * itemsize
         dbuf = random.randint(0, 255, nbyte_max).astype(np.uint8)
         dbuf = dbuf.view(dtype)
         for ii in range(reps):
             n = random.randint(0, nmax, 1)[0]
             data = dbuf[:n]
             shuff = ext.compress_lz4(data)
             out = ext.decompress_lz4(shuff, data.shape, data.dtype)
             self.assertTrue(out.dtype is data.dtype)
             self.assertTrue(np.all(data.view(np.uint8)
                                    == out.view(np.uint8)))
Example #4
0
 def test_circle_with_compression(self):
     nmax = 100000
     reps = 20
     for dtype in TEST_DTYPES:
         itemsize = np.dtype(dtype).itemsize
         nbyte_max = nmax * itemsize
         dbuf = random.randint(0, 255, nbyte_max).astype(np.uint8)
         dbuf = dbuf.view(dtype)
         for ii in range(reps):
             n = random.randint(0, nmax, 1)
             data = dbuf[:n]
             shuff = ext.compress_lz4(data)
             out = ext.decompress_lz4(shuff, data.shape, data.dtype)
             self.assertTrue(out.dtype is data.dtype)
             self.assertTrue(
                 np.all(data.view(np.uint8) == out.view(np.uint8)))