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
bc847734
Commit
bc847734
authored
4 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
make yapf
parent
f62e97f5
No related branches found
No related tags found
Loading
Pipeline
#11571
passed with warnings
4 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: release
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
km3io/rootio.py
+3
-4
3 additions, 4 deletions
km3io/rootio.py
km3io/tools.py
+2
-2
2 additions, 2 deletions
km3io/tools.py
tests/test_tools.py
+2
-1
2 additions, 1 deletion
tests/test_tools.py
with
7 additions
and
7 deletions
km3io/rootio.py
+
3
−
4
View file @
bc847734
...
@@ -143,8 +143,7 @@ class Branch:
...
@@ -143,8 +143,7 @@ class Branch:
self
.
_branch
[
self
.
_keymap
[
key
]].
_context
,
6
)
self
.
_branch
[
self
.
_keymap
[
key
]].
_context
,
6
)
out
=
self
.
_branch
[
self
.
_keymap
[
key
]].
lazyarray
(
out
=
self
.
_branch
[
self
.
_keymap
[
key
]].
lazyarray
(
interpretation
=
interpretation
,
interpretation
=
interpretation
,
basketcache
=
BASKET_CACHE
)
basketcache
=
BASKET_CACHE
)
if
self
.
_index_chain
is
not
None
and
key
in
self
.
_mapper
.
toawkward
:
if
self
.
_index_chain
is
not
None
and
key
in
self
.
_mapper
.
toawkward
:
cache_key
=
self
.
_mapper
.
name
+
'
/
'
+
key
cache_key
=
self
.
_mapper
.
name
+
'
/
'
+
key
if
cache_key
not
in
self
.
_awkward_cache
:
if
cache_key
not
in
self
.
_awkward_cache
:
...
@@ -159,8 +158,8 @@ class Branch:
...
@@ -159,8 +158,8 @@ class Branch:
if
isinstance
(
item
,
str
):
if
isinstance
(
item
,
str
):
return
self
.
__getkey__
(
item
)
return
self
.
__getkey__
(
item
)
if
item
.
__class__
.
__name__
==
"
ChunkedArray
"
:
#
if item.__class__.__name__ == "ChunkedArray":
item
=
np
.
array
(
item
)
#
item = np.array(item)
return
self
.
__class__
(
self
.
_tree
,
return
self
.
__class__
(
self
.
_tree
,
self
.
_mapper
,
self
.
_mapper
,
...
...
This diff is collapsed.
Click to expand it.
km3io/tools.py
+
2
−
2
View file @
bc847734
...
@@ -59,7 +59,7 @@ def unique(array, dtype=np.int64):
...
@@ -59,7 +59,7 @@ def unique(array, dtype=np.int64):
out
[
entry_idx
]
=
last
out
[
entry_idx
]
=
last
for
i
in
range
(
1
,
n
):
for
i
in
range
(
1
,
n
):
current
=
array
[
i
]
current
=
array
[
i
]
if
current
==
last
:
# shortcut for sorted arrays
if
current
==
last
:
# shortcut for sorted arrays
continue
continue
already_present
=
False
already_present
=
False
for
j
in
range
(
entry_idx
+
1
):
for
j
in
range
(
entry_idx
+
1
):
...
@@ -70,7 +70,7 @@ def unique(array, dtype=np.int64):
...
@@ -70,7 +70,7 @@ def unique(array, dtype=np.int64):
entry_idx
+=
1
entry_idx
+=
1
out
[
entry_idx
]
=
current
out
[
entry_idx
]
=
current
last
=
current
last
=
current
return
out
[:
entry_idx
+
1
]
return
out
[:
entry_idx
+
1
]
@nb.jit
(
nopython
=
True
)
@nb.jit
(
nopython
=
True
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_tools.py
+
2
−
1
View file @
bc847734
...
@@ -12,7 +12,8 @@ class TestUnique(unittest.TestCase):
...
@@ -12,7 +12,8 @@ class TestUnique(unittest.TestCase):
max_range
=
100
max_range
=
100
for
i
in
range
(
23
):
for
i
in
range
(
23
):
low
=
np
.
random
.
randint
(
0
,
max_range
)
low
=
np
.
random
.
randint
(
0
,
max_range
)
high
=
np
.
random
.
randint
(
low
+
1
,
low
+
2
+
np
.
random
.
randint
(
max_range
))
high
=
np
.
random
.
randint
(
low
+
1
,
low
+
2
+
np
.
random
.
randint
(
max_range
))
n
=
np
.
random
.
randint
(
max_range
)
n
=
np
.
random
.
randint
(
max_range
)
arr
=
np
.
random
.
randint
(
low
,
high
,
n
).
astype
(
dtype
)
arr
=
np
.
random
.
randint
(
low
,
high
,
n
).
astype
(
dtype
)
np_reference
=
np
.
sort
(
np
.
unique
(
arr
))
np_reference
=
np
.
sort
(
np
.
unique
(
arr
))
...
...
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