diff --git a/changelog.txt b/changelog.txt index 9114428a2..4b5fe6420 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,14 @@ The **signac** package follows `semantic versioning `_. Version 1 ========= +next +---- + +Added ++++++ + + - Support for h5py version 3 (#411). + [1.5.0] -- 2020-09-20 --------------------- diff --git a/signac/core/h5store.py b/signac/core/h5store.py index 98a0a6f2a..24d7cd938 100644 --- a/signac/core/h5store.py +++ b/signac/core/h5store.py @@ -130,6 +130,7 @@ def _h5set(store, grp, key, value, path=None): def _h5get(store, grp, key, path=None): """Retrieve the underlying data for a key from its h5py container.""" + import h5py path = path + '/' + key if path else key result = grp[key] @@ -153,6 +154,11 @@ def _h5get(store, grp, key, path=None): return None elif shape: return result + elif h5py.version.version_tuple.major >= 3 and \ + h5py.check_dtype(vlen=result.dtype) is str: + # h5py >=3.0.0 returns strings as bytes. This returns str for + # consistency with past behavior in signac. + return result.asstr()[()] else: return result[()] except AttributeError: