From e91bcc69e099402e8180352f6d03897bdde02bac Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 22 May 2026 18:47:40 +0100 Subject: [PATCH] Inject test_mode segment into aggregator result_path composition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PyAutoFit #1292 makes PYAUTO_TEST_MODE prepend a test_mode/ segment to AutoFit's output paths. These aggregator integration tests hardcode PYAUTO_TEST_MODE=1 inline and then reconstruct the result directory from conf.instance.output_path; without the segment, agg.add_directory scrapes an empty bare path and the assertions fail. Adds "test_mode" to every path.join(conf.instance.output_path, ...) site that points at a search-output directory. SQLite database file paths stay bare — those files are created at the conf output_path root by Aggregator.from_database, which takes an absolute filename and so bypasses the autofit path-mutation logic. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/aggregator/fit_imaging.py | 4 ++-- scripts/aggregator/fit_interferometer.py | 4 ++-- scripts/aggregator/tracer.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/aggregator/fit_imaging.py b/scripts/aggregator/fit_imaging.py index 11f50b71..3b96d15c 100644 --- a/scripts/aggregator/fit_imaging.py +++ b/scripts/aggregator/fit_imaging.py @@ -32,14 +32,14 @@ def clean(): database_sqlite = path.join(conf.instance.output_path, f"{database_file}.sqlite") if path.exists(database_sqlite): os.remove(database_sqlite) - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) if path.exists(result_path): shutil.rmtree(result_path) @with_config("general", "output", "samples_to_csv", value=True) def aggregator_from(analysis, model, samples): - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) clean() search = al.m.MockSearch( samples=samples, result=al.m.MockResult(model=model, samples=samples) diff --git a/scripts/aggregator/fit_interferometer.py b/scripts/aggregator/fit_interferometer.py index 358fbb9e..745dc2e4 100644 --- a/scripts/aggregator/fit_interferometer.py +++ b/scripts/aggregator/fit_interferometer.py @@ -32,14 +32,14 @@ def clean(): database_sqlite = path.join(conf.instance.output_path, f"{database_file}.sqlite") if path.exists(database_sqlite): os.remove(database_sqlite) - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) if path.exists(result_path): shutil.rmtree(result_path) @with_config("general", "output", "samples_to_csv", value=True) def aggregator_from(analysis, model, samples): - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) clean() search = al.m.MockSearch( samples=samples, result=al.m.MockResult(model=model, samples=samples) diff --git a/scripts/aggregator/tracer.py b/scripts/aggregator/tracer.py index 34a7176b..c457bbf7 100644 --- a/scripts/aggregator/tracer.py +++ b/scripts/aggregator/tracer.py @@ -32,14 +32,14 @@ def clean(): database_sqlite = path.join(conf.instance.output_path, f"{database_file}.sqlite") if path.exists(database_sqlite): os.remove(database_sqlite) - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) if path.exists(result_path): shutil.rmtree(result_path) @with_config("general", "output", "samples_to_csv", value=True) def aggregator_from(analysis, model, samples): - result_path = path.join(conf.instance.output_path, database_file) + result_path = path.join(conf.instance.output_path, "test_mode", database_file) clean() search = al.m.MockSearch( samples=samples, result=al.m.MockResult(model=model, samples=samples)