From 04578ddf0c71fa8053ee2f10179ba2ca4007484b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 15 Aug 2022 18:39:59 +0200 Subject: datafile: acess datasets with byte keys rather than string Required by new h5py API --- datafile.py | 6 ++++-- 1 file 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) -- cgit v1.2.3