Commit 0010a1d8 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '18-error-background-file-too-short-when-preprocessing-enabled' into 'main'

Issue 18 - add validation step to ensure bg noise file is not in input folder

See merge request !49
parents 739bf4c4 140cd037
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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: