Example #1
0
 def test_discovery(self):
     dd = HDF5(self.filename, 'data',
               schema='2 * int32')
     dd.extend([(1, 2), (2, 3), (4, 5)])
     with h5py.File(dd.path) as f:
         d = f.get(dd.datapath)
         self.assertEqual(discover(d),
                          dshape('3 * 2 * int32'))
Example #2
0
    def test_strings(self):
        schema = '{x: int32, y: string}'
        dd = HDF5(self.filename, 'data',
                  schema=schema)
        dd.extend([(1, 'Hello'), (2, 'World!')])

        with h5py.File(dd.path) as f:
            d = f.get(dd.datapath)
            self.assertEqual(discover(d),
                             dshape('2 * ' + schema))