From 140cd037f9123ed056ad7a4c154be7032b088d99 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 11 May 2023 10:43:25 +0200 Subject: [PATCH] add validation step to ensure bg noise file is not in input folder --- ivas_processing_scripts/processing/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ivas_processing_scripts/processing/config.py b/ivas_processing_scripts/processing/config.py index 77ab4e63..7027ce75 100755 --- a/ivas_processing_scripts/processing/config.py +++ b/ivas_processing_scripts/processing/config.py @@ -138,6 +138,12 @@ class TestConfig: if MISSING_KEYS: raise KeyError(f"The following key(s) must be specified : {MISSING_KEYS}") + # validate preprocessing on concatenated file stage + if (pre_proc_2 := getattr(cfg, "preprocessing_2", None)) is not None: + bg_noise_folder = Path(pre_proc_2["background_noise_path"]).parent + if bg_noise_folder.resolve().absolute() == cfg.input_path.resolve().absolute(): + raise ValueError(f"Background noise file has to be placed outside the input folder!") + for cond_name, cond_cfg in cfg.get("conditions_to_generate").items(): type = cond_cfg.get("type") if not type: -- GitLab