From: W. Trevor King Date: Tue, 19 Apr 2011 22:55:34 +0000 (-0400) Subject: dataset.value has been deprecated since h5py version 1.3. X-Git-Tag: 0.5~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bff1db508520bbd3efd0b098948b4f1ea4b26b98;p=pypiezo.git dataset.value has been deprecated since h5py version 1.3. 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[()]. ... --- diff --git a/pypiezo/config.py b/pypiezo/config.py index 4b78d10..878027b 100644 --- a/pypiezo/config.py +++ b/pypiezo/config.py @@ -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()