From 9332484041b17248ba5bc66d9c9a8282d614e82b Mon Sep 17 00:00:00 2001 From: ggmarshall Date: Mon, 19 Feb 2024 22:43:20 +0100 Subject: [PATCH] pre-commit cleanup --- scripts/build_evt.py | 2 +- scripts/build_skm.py | 12 ++++++------ scripts/util/patterns.py | 12 ++++++++++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/scripts/build_evt.py b/scripts/build_evt.py index 910cfa5..e5febca 100644 --- a/scripts/build_evt.py +++ b/scripts/build_evt.py @@ -128,7 +128,7 @@ def replace_evt_with_key(dic, new_key): tcm_group="hardware_tcm_1", dsp_group="dsp", hit_group="hit", - tcm_id_table_pattern="ch{}" + tcm_id_table_pattern="ch{}", ) tbl = Table(col_dict=tables) diff --git a/scripts/build_skm.py b/scripts/build_skm.py index ab61734..773d718 100644 --- a/scripts/build_skm.py +++ b/scripts/build_skm.py @@ -136,12 +136,12 @@ def group_files(fs_evt, fs_hit, fs_dsp, fs_tcm): tables = {} for key, config in skm_config.items(): tables[key] = build_skm( - f_evt = f_evt, - f_hit = f_hit, - f_dsp = f_dsp, - f_tcm = f_tcm, - f_skm= None, - skm_conf = config, + f_evt=f_evt, + f_hit=f_hit, + f_dsp=f_dsp, + f_tcm=f_tcm, + f_skm=None, + skm_conf=config, skm_group=f"skm/{key}" if key != "all" else "skm", evt_group="evt", tcm_group="hardware_tcm_1", diff --git a/scripts/util/patterns.py b/scripts/util/patterns.py index a542fad..21fa1a5 100644 --- a/scripts/util/patterns.py +++ b/scripts/util/patterns.py @@ -209,7 +209,11 @@ def get_pattern_tier(setup, tier, check_in_cycle=True): else: msg = "invalid tier" raise Exception(msg) - if tier_path(setup) not in file_pattern and check_in_cycle is True and ".." not in file_pattern: + if ( + tier_path(setup) not in file_pattern + and check_in_cycle is True + and ".." not in file_pattern + ): return "/tmp/{experiment}-{period}-{run}-{datatype}-{timestamp}" + f"tier_{tier}.lh5" else: return file_pattern @@ -387,7 +391,11 @@ def get_pattern_pars(setup, tier, name=None, extension="json", check_in_cycle=Tr else: msg = "invalid tier" raise Exception(msg) - if pars_path(setup) not in file_pattern and check_in_cycle is True and ".." not in file_pattern: + if ( + pars_path(setup) not in file_pattern + and check_in_cycle is True + and ".." not in file_pattern + ): if name is None: return "/tmp/{experiment}-{period}-{run}-cal-{timestamp}" + f"par_{tier}.{extension}" else: