BZIP2/test/create_test_data.py
raw| 1 | # |
| 2 | # script used to create test data for BZIP2 readback test |
| 3 | # |
| 4 | from __future__ import print_function |
| 5 | import numpy |
| 6 | import tables |
| 7 | |
| 8 | |
| 9 | fname = 'ui8_data.h5' |
| 10 | shape = (10,) |
| 11 | atom = tables.UInt8Atom() |
| 12 | filters = tables.Filters(complevel=2,complib='bzip2') |
| 13 | |
| 14 | f = tables.open_file(fname,'w') |
| 15 | a = f.create_carray(f.root,'data',atom,shape,filters=filters) |
| 16 | a[:] = numpy.arange(0,10,dtype='u8') |
| 17 | f.close() |