Commit 4132573d authored by connor.hainje@pnnl.gov's avatar connor.hainje@pnnl.gov
Browse files

Add a flag to make_all for whether to create a 'labels' column

parent 84ead851
......@@ -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]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment