Use 'read' instead of 'append' as the file mode in Calibrator.load_raw().
authorW. Trevor King <wking@drexel.edu>
Fri, 20 Apr 2012 17:57:25 +0000 (13:57 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 Apr 2012 17:57:25 +0000 (13:57 -0400)
It's safer that way (less chance of corrupting your data).

calibcant/calibrate.py

index da7e7cf10e76c83b862e0fb8ca28b0688357b23c..8a68cbe01dbf8694b49f8c5a0738ea29b5a7bf52 100644 (file)
@@ -593,7 +593,7 @@ class Calibrator (object):
     def load_raw(self, filename=None, group='/'):
         """Load results saved during `.aquire()` by bumps, etc."""
         data = {}
-        with _h5py.File(filename, 'a') as f:
+        with _h5py.File(filename, 'r') as f:
             for name,loader in [('bump',_bump_load),
                                 ('temperature', _temperature_load),
                                 ('vibration', _vibration_load),