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
70d3cf6a
Commit
70d3cf6a
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Deactivate iteration which was not implemented anyways
parent
bda704e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
km3io/rootio.py
+7
-0
7 additions, 0 deletions
km3io/rootio.py
tests/test_offline.py
+4
-0
4 additions, 0 deletions
tests/test_offline.py
with
11 additions
and
0 deletions
km3io/rootio.py
+
7
−
0
View file @
70d3cf6a
...
...
@@ -354,6 +354,13 @@ class Branch:
return
unfold_indices
(
self
.
_branch
[
key
].
array
(),
self
.
_index_chain
)
def
__iter__
(
self
):
raise
NotImplementedError
(
"
iterating over a nested branch is not supported nor recommended.
"
"
If you really feel you need to do it, open an issue in
"
"
https://git.km3net.de/km3py/km3io
"
)
def
__getitem__
(
self
,
key
):
return
self
.
__class__
(
self
.
_branch
,
self
.
fields
,
self
.
_aliases
,
self
.
_index_chain
+
[
key
]
...
...
This diff is collapsed.
Click to expand it.
tests/test_offline.py
+
4
−
0
View file @
70d3cf6a
...
...
@@ -235,6 +235,10 @@ class TestOfflineEvents(unittest.TestCase):
with
self
.
assertRaises
(
NotImplementedError
):
[
e
.
id
for
e
in
self
.
events
[
2
:
8
][
2
:
4
]]
def
test_iteration_over_subbranches_raises
(
self
):
with
self
.
assertRaises
(
NotImplementedError
):
[
t
for
t
in
self
.
events
[
0
].
tracks
]
def
test_str
(
self
):
assert
str
(
self
.
n_events
)
in
str
(
self
.
events
)
...
...
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