fix: inject test_mode segment into aggregator result paths#61
Merged
Conversation
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migration for PyAutoFit #1292, which makes
PYAUTO_TEST_MODEnamespace AutoFit output paths underoutput/test_mode/.... The aggregator integration tests hardcodePYAUTO_TEST_MODE=1inline and reconstruct the result directory by joiningconf.instance.output_pathwith the database name — they need thetest_mode/segment too, otherwiseadd_directoryscrapes an empty bare path and the assertions fail.Scripts Changed
scripts/aggregator/galaxies.py— added"test_mode"toresult_pathcomposition (2 sites)scripts/aggregator/fit_imaging.py— added"test_mode"toresult_pathandadd_directory(...)for bothdatabase_fileanddb_file_imaging(5 sites)scripts/aggregator/fit_interferometer.py— same pattern fordatabase_fileanddb_file_inter(5 sites)scripts/aggregator/ellipse.py— added"test_mode"toresult_pathcomposition (2 sites)Upstream PR
PyAutoLabs/PyAutoFit#1292
Test Plan
PYAUTO_TEST_MODE=2with the worktree's modified autofit/smoke_test autogalaxy_workspace_testgreen🤖 Generated with Claude Code