Skip to content

Commit

Permalink
H5SpecReader: Support SIMPLE HDF5 dataspaces as well (#80)
Browse files Browse the repository at this point in the history
Some programs like Igor Pro always write SIMPLE dataspaces instead of
SCALAR ones. As we should not care about the exact type, we dig now
deeper if we find an array with just one element.
  • Loading branch information
t-b authored and rly committed Aug 1, 2019
1 parent 1cbbce6 commit c8f9374
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hdmf/backends/hdf5/h5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ def __init__(self, **kwargs):

def __read(self, path):
s = self.__group[path][()]

if isinstance(s, np.ndarray) \
and s.shape == (1,):
s = s[0]

if isinstance(s, bytes):
s = s.decode('UTF-8')
d = json.loads(s)
Expand Down

0 comments on commit c8f9374

Please sign in to comment.