From 2db3074f8ecef8229f40d538165c42973f1ccbd2 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 20 Jun 2023 12:16:28 +0200 Subject: [PATCH 1/2] fix naming of in/out folders for BS1534 tests in generate_test --- generate_test.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/generate_test.py b/generate_test.py index f79fc92a..6a15ab59 100755 --- a/generate_test.py +++ b/generate_test.py @@ -112,8 +112,23 @@ def create_experiment_setup(experiment, lab) -> list[Path]: cfgs = list() for cat in categories: suffix = cat + f"-lab_{lab}" - input_path = base_path.joinpath(f"proc_input_{lab}").joinpath(cat) - output_path = base_path.joinpath(f"proc_output_{lab}").joinpath(cat) + + input_path = base_path.joinpath(f"proc_input_{lab}") + output_path = base_path.joinpath(f"proc_output_{lab}") + + if experiment in EXPERIMENTS_P800: + input_path = input_path.joinpath(cat) + output_path = output_path.joinpath(cat) + cfg_path = default_cfg_path.parent.joinpath(f"{experiment}-{cat}-lab_{lab}.yml") + # this is for catching the Mushra MASA tests + elif experiment in IN_FMT_FOR_MASA_EXPS: + fmt = fmt_for_category[cat] + input_path = input_path.joinpath(fmt) + output_path = output_path.joinpath(fmt) + cfg_path = default_cfg_path.parent.joinpath(f"{experiment}-{fmt}-lab_{lab}.yml") + elif experiment in EXPERIMENTS_BS1534: + cfg_path = default_cfg_path.parent.joinpath(f"{experiment}-lab_{lab}.yml") + if experiment == "P800-2": bg_noise_path = base_path.joinpath("background_noise").joinpath( f"background_noise_{suffix}.wav" @@ -122,7 +137,7 @@ def create_experiment_setup(experiment, lab) -> list[Path]: bg_noise_path = base_path.joinpath("background_noise").joinpath( f"background_noise_{cat}.wav" ) - cfg_path = default_cfg_path.parent.joinpath(f"{experiment}{cat}-lab_{lab}.yml") + cfgs.append(cfg_path) # set new lab- and category-dependent values -- GitLab From 85772cf51264bd74a668187e8e3bdb5e35e76015 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 20 Jun 2023 12:29:59 +0200 Subject: [PATCH 2/2] fix bug in generate_test.py --- generate_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate_test.py b/generate_test.py index 6a15ab59..02e2bbf4 100755 --- a/generate_test.py +++ b/generate_test.py @@ -116,6 +116,7 @@ def create_experiment_setup(experiment, lab) -> list[Path]: input_path = base_path.joinpath(f"proc_input_{lab}") output_path = base_path.joinpath(f"proc_output_{lab}") + fmt_for_category = IN_FMT_FOR_MASA_EXPS.get(experiment, None) if experiment in EXPERIMENTS_P800: input_path = input_path.joinpath(cat) output_path = output_path.joinpath(cat) @@ -162,7 +163,7 @@ def create_experiment_setup(experiment, lab) -> list[Path]: ) # for MASA, the input format can differ between categories - if (fmt_for_category := IN_FMT_FOR_MASA_EXPS.get(experiment, None)) is not None: + if fmt_for_category is not None: cfg.input["fmt"] = fmt_for_category[cat] # ensure that necessary directories are there -- GitLab