Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
km3py
km3io
Commits
b64bc8f5
Commit
b64bc8f5
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics
parent
483eab58
No related branches found
No related tags found
1 merge request
!47
Resolve "uproot4 integration"
Pipeline
#16332
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/rootio.py
+7
-21
7 additions, 21 deletions
km3io/rootio.py
with
7 additions
and
21 deletions
km3io/rootio.py
+
7
−
21
View file @
b64bc8f5
...
...
@@ -34,19 +34,19 @@ class EventReader:
Parameters
----------
f: str or uproot4.reading.ReadOnlyDirectory (from uproot4.open)
f
: str or uproot4.reading.ReadOnlyDirectory (from uproot4.open)
Path to the file of interest or uproot4 filedescriptor.
step_size: int, optional
step_size
: int, optional
Number of events to read into the cache when iterating.
Choosing higher numbers may improve the speed but also increases
the memory overhead.
index_chain: list, optional
index_chain
: list, optional
Keeps track of index chaining.
keys: list or set, optional
keys
: list or set, optional
Branch keys.
aliases: dict, optional
aliases
: dict, optional
Branch key aliases.
event_ctor: class or namedtuple, optional
event_ctor
: class or namedtuple, optional
Event constructor.
"""
...
...
@@ -65,20 +65,6 @@ class EventReader:
self
.
_event_ctor
=
event_ctor
self
.
_index_chain
=
[]
if
index_chain
is
None
else
index_chain
# if aliases is not None:
# self.aliases = aliases
# else:
# # Check for usr-awesomeness backward compatibility crap
# if "E/Evt/AAObject/usr" in self._fobj:
# print("Found usr data")
# if ak.count(f["E/Evt/AAObject/usr"].array()) > 0:
# self.aliases.update(
# {
# "usr": "AAObject/usr",
# "usr_names": "AAObject/usr_names",
# }
# )
if
self
.
_keys
is
None
:
self
.
_initialise_keys
()
...
...
@@ -176,7 +162,6 @@ class EventReader:
if
from_field
in
branch
[
key
].
keys
():
fields
.
append
(
to_field
)
log
.
debug
(
fields
)
# out = branch[key].arrays(fields, aliases=self.nested_branches[key])
return
Branch
(
branch
[
key
],
fields
,
self
.
nested_branches
[
key
],
self
.
_index_chain
)
else
:
return
unfold_indices
(
branch
[
self
.
aliases
.
get
(
key
,
key
)].
array
(),
self
.
_index_chain
)
...
...
@@ -244,6 +229,7 @@ class EventReader:
return
self
.
_fobj
[
self
.
event_path
].
num_entries
elif
isinstance
(
self
.
_index_chain
[
-
1
],
(
int
,
np
.
int32
,
np
.
int64
)):
if
len
(
self
.
_index_chain
)
==
1
:
# TODO: not sure why this is needed at all, it's too late...
return
1
# try:
# return len(self[:])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment