diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-08-15 18:39:59 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-08-15 18:45:16 +0200 |
commit | 04578ddf0c71fa8053ee2f10179ba2ca4007484b (patch) | |
tree | 5e7ab84c7c24ce59841cacfeb20370c944575c7d | |
parent | 472140a3886689f986cfd803d4dd38fe72ec89ce (diff) |
datafile: acess datasets with byte keys rather than string
Required by new h5py API
-rw-r--r-- | datafile.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/datafile.py b/datafile.py index 5b83bf0..5a09c4d 100644 --- a/datafile.py +++ b/datafile.py @@ -116,9 +116,11 @@ class _DataSet(object): return '<%s>@<%s>' % (self.name, self._df.path) def _slice_single_component(self, it, rl, component = None): - querystr = '%s it=%d tl=0 rl=%d' % (self.name, it, rl) + querystr = b'%s it=%d tl=0 rl=%d' % (self.name.encode('ascii'), it, rl) + if component is not None: - querystr += ' c=%d' % component + querystr += b' c=%d' % component + data = self._df._f[querystr] layout = _SliceLayout(data.attrs['origin'], data.attrs['delta'], data.shape[::-1]) return _DataSlice(data, layout) |