use real data in test
# coding: utf-8
-
+from __future__ import print_function
import h5py
import tempfile
+import numpy as np
with tempfile.NamedTemporaryFile() as ntf:
f = h5py.File(ntf.name)
complevel = 9
complib = 'blosc:lz4'
shuffle = True
+ data = np.random.random((1000, 1000))
compressors = ('blosclz', 'lz4', 'lz4hc', 'snappy', 'zlib', 'zstd')
for c in compressors:
complib = tuple('blosc:' + c for c in compressors).index('blosc:%s' % c)
@@ -15,5 +17,6 @@ with tempfile.NamedTemporaryFile() as ntf:
'compression': 32001,
'compression_opts': (0, 0, 0, 0, complevel, shuffle, complib)
}
- f.create_dataset('test_%s' % c, shape=(100, 1000), **args)
+ print('compression args:', args)
+ f.create_dataset('test_%s' % c, data=data, chunks=True, **args)
