def test_load(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'Mat', self.Mat)
     del F
     F = h5py.File('temp_out.hdf5', 'r')
     new_Mat = algebra.load_h5(F, 'Mat')
     self.assertTrue(np.all(new_Mat == self.Mat))
     self.assertTrue(new_Mat.info == self.Mat.info)
Example #2
0
 def test_load(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'Mat', self.Mat)
     del F
     F = h5py.File('temp_out.hdf5', 'r')
     new_Mat = algebra.load_h5(F, 'Mat')
     self.assertTrue(np.all(new_Mat == self.Mat))
     self.assertTrue(new_Mat.info == self.Mat.info)
 def test_save(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'Mat', self.Mat)
     # Check that the object is there.
     self.assertTrue('Mat' in F.keys())
     # Make sure it has the same data.
     self.assertTrue(np.all(F['Mat'][...] == self.Mat))
     # Check that the meta data is all there, but in string form.
     self.assertEqual(F['Mat'].attrs['a'], '42')
     self.assertEqual(F['Mat'].attrs['b'], "'a string'")
Example #4
0
 def test_save(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'Mat', self.Mat)
     # Check that the object is there.
     self.assertTrue('Mat' in F.keys())
     # Make sure it has the same data.
     self.assertTrue(np.all(F['Mat'][...] == self.Mat))
     # Check that the meta data is all there, but in string form.
     self.assertEqual(F['Mat'].attrs['a'], '42')
     self.assertEqual(F['Mat'].attrs['b'], "'a string'")
 def test_save_deep(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'here/there/Mat', self.Mat)
     self.assertTrue('here' in F.keys())
     self.assertTrue(np.all(F['here/there/Mat'][...] == self.Mat))
Example #6
0
 def test_save_deep(self):
     F = h5py.File('temp_out.hdf5', 'w')
     algebra.save_h5(F, 'here/there/Mat', self.Mat)
     self.assertTrue('here' in F.keys())
     self.assertTrue(np.all(F['here/there/Mat'][...] == self.Mat))