dataset.value has been deprecated since h5py version 1.3.
authorW. Trevor King <wking@drexel.edu>
Tue, 19 Apr 2011 22:55:34 +0000 (18:55 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 19 Apr 2011 22:55:34 +0000 (18:55 -0400)
From http://mail.scipy.org/pipermail/scipy-user/2010-February/024364.html

[SciPy-User] [ANN] HDF5 for Python (h5py) 1.3.0 beta
Andrew Collette andrew.collette@gmail....
Tue Feb 23 15:52:12 CST 2010

...
 - Dataset .value attribute is deprecated.  Use dataset[...] or dataset[()].
...

pypiezo/config.py

index 4b78d104c6d35a4a64ae77037123a4d3ed26731e..878027b84886ab7f99bb44ce43a2ce67e7e1492f 100644 (file)
@@ -456,7 +456,7 @@ def _pformat_hdf5(cwg, depth=0):
             lines.extend(_pformat_hdf5(value, depth))
         elif isinstance(value, _h5py.Dataset):
             lines.append('  '*depth + str(value))
-            lines.append('  '*(depth+1) + str(value.value))
+            lines.append('  '*(depth+1) + str(value[...]))
         else:
             lines.append('  '*depth + str(value))
     return lines
@@ -550,7 +550,7 @@ class _HDF5Config (_BackedConfig):
                     help_string = '\t(%s)' % settings[key].help()
                 else:
                     help_string = ''
-                lines.append('%s: %s%s' % (key, value.value, help_string))
+                lines.append('%s: %s%s' % (key, value[...], help_string))
             return '\n'.join(lines)
         return super(_HDF5Config, self).dump(help=help)
 
@@ -564,7 +564,7 @@ class _HDF5Config (_BackedConfig):
         for s in self.settings:
             if s.name not in group.keys():
                 continue
-            self[s.name] = s.convert_from_text(group[s.name].value)
+            self[s.name] = s.convert_from_text(group[s.name][...])
         if f:
             f.close()
 
@@ -576,7 +576,12 @@ class _HDF5Config (_BackedConfig):
         else:
             f = None
         for s in self.settings:
-            group[s.name] = s.convert_to_text(self[s.name])
+            try:
+                dataset = group[s.name]
+            except KeyError:
+                group[s.name] = s.convert_to_text(self[s.name])
+            else:
+                group[s.name][...] = s.convert_to_text(self[s.name])
         if f:
             f.close()