Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 6, 2024
1 parent 40eec51 commit 042217a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/pygama/evt/modules/geds.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def apply_xtalk_correction(
)
energies_corr = ak.from_regular(energies_corr)
multiplicity_mask = ak.from_regular(multiplicity_mask)
tcm_id_array=ak.from_regular(tcm_id_array)
tcm_id_array = ak.from_regular(tcm_id_array)

if mode == "energy":
return types.VectorOfVectors(energies_corr[multiplicity_mask])
Expand Down Expand Up @@ -208,12 +208,10 @@ def apply_xtalk_correction_and_calibrate(
xtalk_matrix_rawids,
)


calibrated_corr = ak.from_regular(calibrated_corr)
multiplicity_mask = ak.from_regular(multiplicity_mask)
tcm_id_array = ak.from_regular(tcm_id_array)


if mode == "energy":
return types.VectorOfVectors(calibrated_corr[multiplicity_mask])
elif mode == "tcm_id":
Expand Down
13 changes: 5 additions & 8 deletions src/pygama/evt/modules/xtalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ def build_energy_array(
for name, file, group, column in tier_params:
try:
# read the energy data
data = lh5.read(
f"ch{channel}/{group}/{column}", file, idx=idx_events
)
data = lh5.read(f"ch{channel}/{group}/{column}", file, idx=idx_events)
tbl.add_column(name, data)
except (lh5.exceptions.LH5DecodeError,KeyError):
except (lh5.exceptions.LH5DecodeError, KeyError):
tbl.add_column(name, types.Array(np.full_like(idx_events, np.nan)))

res = tbl.eval(observable)
Expand Down Expand Up @@ -154,11 +152,10 @@ def filter_hits(
for name, file, group, column in tier_params:
try:
# read the energy data
data = lh5.read(
f"ch{channel}/{group}/{column}", file, idx=idx_events)

data = lh5.read(f"ch{channel}/{group}/{column}", file, idx=idx_events)

tbl.add_column(name, data)
except (lh5.exceptions.LH5DecodeError,KeyError):
except (lh5.exceptions.LH5DecodeError, KeyError):
tbl.add_column(name, types.Array(np.full_like(idx_events, np.nan)))

# add the corrected energy to the table
Expand Down

0 comments on commit 042217a

Please sign in to comment.