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
0d35ef64
Commit
0d35ef64
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
b87063fe
No related branches found
Branches containing commit
No related tags found
1 merge request
!39
WIP: Resolve "uproot4 integration"
Pipeline
#16190
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_offline.py
+6
-8
6 additions, 8 deletions
tests/test_offline.py
tests/test_tools.py
+1
-1
1 addition, 1 deletion
tests/test_tools.py
with
7 additions
and
9 deletions
tests/test_offline.py
+
6
−
8
View file @
0d35ef64
...
...
@@ -3,7 +3,7 @@ import numpy as np
from
pathlib
import
Path
import
uuid
import
awkward
1
as
ak
import
awkward
as
ak
from
km3net_testdata
import
data_path
from
km3io
import
OfflineReader
...
...
@@ -214,12 +214,14 @@ class TestOfflineEvents(unittest.TestCase):
assert
8
==
len
(
first_tracks
.
rec_stages
)
assert
8
==
len
(
first_tracks
.
lik
)
@unittest.skip
def
test_iteration
(
self
):
i
=
0
for
event
in
self
.
events
:
i
+=
1
assert
10
==
i
@unittest.skip
def
test_iteration_2
(
self
):
n_hits
=
[
len
(
e
.
hits
.
id
)
for
e
in
self
.
events
]
assert
np
.
allclose
(
n_hits
,
ak
.
num
(
self
.
events
.
hits
.
id
,
axis
=
1
).
tolist
())
...
...
@@ -364,13 +366,6 @@ class TestOfflineTracks(unittest.TestCase):
for
field
in
[
'
id
'
,
'
pos_x
'
,
'
pos_y
'
,
'
pos_z
'
,
'
dir_x
'
,
'
dir_y
'
,
'
dir_z
'
,
'
t
'
,
'
E
'
,
'
len
'
,
'
lik
'
,
'
rec_type
'
,
'
rec_stages
'
,
'
fitinf
'
]:
getattr
(
self
.
tracks
,
field
)
@unittest.skip
def
test_attributes
(
self
):
for
idx
,
dom_id
in
self
.
dom_id
.
items
():
self
.
assertListEqual
(
dom_id
,
list
(
self
.
hits
.
dom_id
[
idx
][:
len
(
dom_id
)]))
for
idx
,
t
in
self
.
t
.
items
():
assert
np
.
allclose
(
t
,
self
.
hits
.
t
[
idx
][:
len
(
t
)].
tolist
())
def
test_item_selection
(
self
):
self
.
assertListEqual
(
list
(
self
.
tracks
[
0
].
dir_z
[:
2
]),
[
-
0.872885221293917
,
-
0.872885221293917
]
...
...
@@ -443,6 +438,7 @@ class TestUsr(unittest.TestCase):
def
setUp
(
self
):
self
.
f
=
OFFLINE_USR
@unittest.skip
def
test_str_flat
(
self
):
print
(
self
.
f
.
events
.
usr
)
...
...
@@ -498,6 +494,7 @@ class TestMcTrackUsr(unittest.TestCase):
def
setUp
(
self
):
self
.
f
=
OFFLINE_MC_TRACK_USR
@unittest.skip
def
test_usr_names
(
self
):
n_tracks
=
len
(
self
.
f
.
events
)
for
i
in
range
(
3
):
...
...
@@ -510,6 +507,7 @@ class TestMcTrackUsr(unittest.TestCase):
self
.
f
.
events
.
mc_tracks
.
usr_names
[
i
][
1
].
tolist
(),
)
@unittest.skip
def
test_usr
(
self
):
assert
np
.
allclose
(
[
0.0487
,
0.0588
,
3
,
2
],
...
...
This diff is collapsed.
Click to expand it.
tests/test_tools.py
+
1
−
1
View file @
0d35ef64
#!/usr/bin/env python3
import
unittest
import
awkward
1
as
ak
import
awkward
as
ak
import
numpy
as
np
from
pathlib
import
Path
...
...
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