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
8b957bb0
Commit
8b957bb0
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Fix imports for Python 3.6
parent
8a13c18a
No related branches found
No related tags found
No related merge requests found
Pipeline
#14220
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/tools.py
+12
-10
12 additions, 10 deletions
km3io/tools.py
with
12 additions
and
10 deletions
km3io/tools.py
+
12
−
10
View file @
8b957bb0
...
...
@@ -4,7 +4,9 @@ import numpy as np
import
awkward1
as
ak1
import
uproot
import
km3io.definitions
as
kdef
from
km3io.definitions
import
reconstructions
as
krec
from
km3io.definitions
import
trigger
as
ktrg
from
km3io.definitions
import
fitparameters
as
kfit
# 110 MB based on the size of the largest basket found so far in km3net
BASKET_CACHE_SIZE
=
110
*
1024
**
2
...
...
@@ -105,7 +107,7 @@ def w2list_genhen_keys():
dict_keys
genhen w2list keys.
"""
return
k
def
.
reconstruction
.
w2list_genhen
.
keys
()
return
k
rec
.
w2list_genhen
.
keys
()
def
w2list_gseagen_keys
():
...
...
@@ -117,7 +119,7 @@ def w2list_gseagen_keys():
dict_keys
gseagen w2list keys.
"""
return
k
def
.
reconstruction
.
w2list_gseagen
.
keys
()
return
k
rec
.
w2list_gseagen
.
keys
()
def
get_w2list_param
(
events
,
generator
,
param
):
...
...
@@ -141,9 +143,9 @@ def get_w2list_param(events, generator, param):
array of the values of interest.
"""
if
generator
==
"
gseagen
"
:
return
events
.
w2list
[:,
k
def
.
reconstruction
.
w2list_gseagen
[
param
]]
return
events
.
w2list
[:,
k
rec
.
w2list_gseagen
[
param
]]
if
generator
==
"
genhen
"
:
return
events
.
w2list
[:,
k
def
.
reconstruction
.
w2list_genhen
[
param
]]
return
events
.
w2list
[:,
k
rec
.
w2list_genhen
[
param
]]
def
rec_types
():
...
...
@@ -155,7 +157,7 @@ def rec_types():
dict_keys
reconstruction types.
"""
return
k
def
.
reconstruction
.
keys
()
return
k
rec
.
keys
()
def
fitinf
(
fitparam
,
tracks
):
...
...
@@ -176,7 +178,7 @@ def fitinf(fitparam, tracks):
awkward array of the values of the fit parameter requested.
"""
fit
=
tracks
.
fitinf
index
=
k
def
.
fitparameters
[
fitparam
]
index
=
k
fit
[
fitparam
]
try
:
params
=
fit
[
count_nested
(
fit
,
axis
=
2
)
>
index
]
return
ak1
.
Array
([
i
[:,
index
]
for
i
in
params
])
...
...
@@ -195,7 +197,7 @@ def fitparams():
dict_keys
fit parameters keys.
"""
return
k
def
.
fitparameters
.
keys
()
return
k
fit
.
keys
()
def
count_nested
(
Array
,
axis
=
0
):
...
...
@@ -328,12 +330,12 @@ def best_track(tracks, strategy="default", rec_type=None):
if
strategy
==
"
default
"
and
rec_type
is
not
None
:
if
n_events
==
1
:
rec_types
=
tracks
[
tracks
.
rec_type
==
k
def
.
reconstruction
[
rec_type
]]
rec_types
=
tracks
[
tracks
.
rec_type
==
k
rec
[
rec_type
]]
len_stages
=
count_nested
(
rec_types
.
rec_stages
,
axis
=
1
)
longest
=
rec_types
[
len_stages
==
ak1
.
max
(
len_stages
,
axis
=
0
)]
out
=
longest
[
longest
.
lik
==
ak1
.
max
(
longest
.
lik
,
axis
=
0
)]
else
:
rec_types
=
tracks
[
tracks
.
rec_type
==
k
def
.
reconstruction
[
rec_type
]]
rec_types
=
tracks
[
tracks
.
rec_type
==
k
rec
[
rec_type
]]
len_stages
=
count_nested
(
rec_types
.
rec_stages
,
axis
=
2
)
longest
=
rec_types
[
len_stages
==
ak1
.
max
(
len_stages
,
axis
=
1
)]
out
=
longest
[
longest
.
lik
==
ak1
.
max
(
longest
.
lik
,
axis
=
1
)]
...
...
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