Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Connor Hainje
pidanalysis
Commits
4132573d
Commit
4132573d
authored
Jan 03, 2022
by
connor.hainje@pnnl.gov
Browse files
Add a flag to make_all for whether to create a 'labels' column
parent
84ead851
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/pidplots/pidplots/data.py
View file @
4132573d
...
...
@@ -94,8 +94,9 @@ def make_contrib(d):
d
[
f
"contrib_
{
det
}
"
]
=
ctrb
def
make_all
(
df
):
make_labels
(
df
)
def
make_all
(
df
,
labels
=
True
):
if
labels
:
make_labels
(
df
)
make_bins
(
df
)
make_lrs
(
df
)
make_pid
(
df
)
...
...
@@ -161,7 +162,7 @@ def read_h5(
_cut_particles
(
df
,
allowed_particles
)
if
compute_cols
:
make_all
(
df
)
make_all
(
df
,
labels
=
True
)
if
drop_nans
:
df
.
dropna
(
inplace
=
True
)
df
=
df
[
df
[
"labels"
]
>=
0
]
...
...
@@ -192,13 +193,7 @@ def read_npz(
_cut_particles
(
df
,
allowed_particles
)
if
compute_cols
:
make_bins
(
df
)
make_lrs
(
df
)
make_pid
(
df
)
make_binary_lrs
(
df
)
make_pid_det
(
df
)
make_pid_abl
(
df
)
make_contrib
(
df
)
make_all
(
df
,
labels
=
False
)
if
drop_nans
:
df
.
dropna
(
inplace
=
True
)
df
=
df
[
df
[
"labels"
]
>=
0
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment