Skip to content
Snippets Groups Projects

Resolve "uproot4 integration"

Merged Tamas Gal requested to merge 58-uproot4-integration-2 into master
Compare and Show latest version
3 files
+ 21
23
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 5
3
@@ -186,8 +186,10 @@ class OfflineReader:
def __getitem__(self, key):
# indexing
if isinstance(key, (slice, int, np.int32, np.int64)):
if not isinstance(key, slice):
# TODO: maybe just propagate everything to awkward and let it deal
# with the type?
if isinstance(key, (slice, int, np.int32, np.int64, list, np.ndarray, ak.Array)):
if isinstance(key, (int, np.int32, np.int64)):
key = int(key)
return self.__class__(
self._fobj,
@@ -296,7 +298,7 @@ class OfflineReader:
return 1
else:
# ignore the usual index magic and access `id` directly
return len(self._fobj[self.event_path]["id"].array(), self._index_chain)
return len(unfold_indices(self._fobj[self.event_path]["id"].array(), self._index_chain))
def __actual_len__(self):
"""The raw number of events without any indexing/slicing magic"""
Loading