File: create_test_data.py

package info (click to toggle)
hdf5-filter-plugin 0.0~git20221111.49e3b65-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,848 kB
  • sloc: ansic: 14,374; sh: 11,445; cpp: 1,463; makefile: 100; python: 19; xml: 6
file content (17 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# script used to create test data for BZIP2 readback test
#
from __future__ import print_function
import numpy
import tables


fname = 'ui8_data.h5'
shape = (10,)
atom = tables.UInt8Atom()
filters = tables.Filters(complevel=2,complib='bzip2')

f = tables.open_file(fname,'w')
a = f.create_carray(f.root,'data',atom,shape,filters=filters)
a[:] = numpy.arange(0,10,dtype='u8')
f.close()