diff options
author | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
commit | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (patch) | |
tree | 45d462ed36a5522e9f3b9fde6c4ec4918c2ae8e3 /silx/io/octaveh5.py | |
parent | cebdc9244c019224846cb8d2668080fe386a6adc (diff) |
New upstream version 0.10.1+dfsg
Diffstat (limited to 'silx/io/octaveh5.py')
-rw-r--r-- | silx/io/octaveh5.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/silx/io/octaveh5.py b/silx/io/octaveh5.py index e63c026..04e3890 100644 --- a/silx/io/octaveh5.py +++ b/silx/io/octaveh5.py @@ -51,12 +51,7 @@ Here is an example of a simple read and write : import logging logger = logging.getLogger(__name__) import numpy as np - -try: - import h5py -except ImportError as e: - logger.error("Module " + __name__ + " requires h5py") - raise e +import h5py __authors__ = ["C. Nemoz", "H. Payno"] __license__ = "MIT" @@ -117,12 +112,12 @@ class Octaveh5(object): return None for key, val in iter(dict(gr_level2).items()): - data_dict[str(key)] = list(val.items())[1][1].value + data_dict[str(key)] = list(val.items())[1][1][()] - if list(val.items())[0][1].value != np.string_('sq_string'): + if list(val.items())[0][1][()] != np.string_('sq_string'): data_dict[str(key)] = float(data_dict[str(key)]) else: - if list(val.items())[0][1].value == np.string_('sq_string'): + if list(val.items())[0][1][()] == np.string_('sq_string'): # in the case the string has been stored as an nd-array of char if type(data_dict[str(key)]) is np.ndarray: data_dict[str(key)] = "".join(chr(item) for item in data_dict[str(key)]) |