From 495d215cfc80d0bceb5c23461cacd9fbc23d8b8c Mon Sep 17 00:00:00 2001 From: Toby Dixon Date: Sat, 4 May 2024 23:57:00 +0200 Subject: [PATCH] style fixes --- src/pygama/evt/modules/xtalk.py | 10 ++++------ tests/evt/test_build_evt.py | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pygama/evt/modules/xtalk.py b/src/pygama/evt/modules/xtalk.py index dd3dfc895..7593608ef 100644 --- a/src/pygama/evt/modules/xtalk.py +++ b/src/pygama/evt/modules/xtalk.py @@ -64,11 +64,10 @@ def build_energy_array( list of channel rawids from the cross talk matrix. """ - - # replace group. with group___ + # replace group. with group___ for tier in datainfo._asdict(): group = datainfo._asdict()[tier].group - observable= observable.replace(f"{group}.", f"{group}___") + observable = observable.replace(f"{group}.", f"{group}___") observable = observable.replace(".", "__") @@ -88,9 +87,8 @@ def build_energy_array( # import function into current namespace importlib.import_module(package) - # initialise the output object - energies_out = np.full(( np.max(tcm.idx) + 1,len(rawids)), np.nan) + energies_out = np.full((np.max(tcm.idx) + 1, len(rawids)), np.nan) for idx_chan, channel in enumerate(rawids): tbl = types.Table() @@ -108,12 +106,12 @@ def build_energy_array( except KeyError: tbl.add_column(name, np.full_like(idx_events, np.nan)) - res = tbl.eval(observable) energies_out[idx_events, idx_chan] = res.nda return energies_out + def filter_hits( datainfo: utils.DataInfo, tcm: utils.TCMData, diff --git a/tests/evt/test_build_evt.py b/tests/evt/test_build_evt.py index 378439a10..99bf66d6f 100644 --- a/tests/evt/test_build_evt.py +++ b/tests/evt/test_build_evt.py @@ -26,7 +26,6 @@ def files_config(lgnd_test_data, tmptestdir): } - def test_basics(lgnd_test_data, files_config): build_evt( files_config,