fix: neutralize smoke-mode env vars in _quick_fit.py helper#60
Merged
fix: neutralize smoke-mode env vars in _quick_fit.py helper#60
Conversation
The four aggregator tutorials (scripts/guides/results/aggregator/
data_fitting.py and models.py) crash with TypeError at
PyAutoGalaxy/autogalaxy/aggregator/agg_util.py:101 when run in fast
smoke mode (PYAUTO_TEST_MODE=2 + PYAUTO_SKIP_VISUALIZATION=1). The
_quick_fit.py helper they invoke via subprocess inherits those env
vars, which suppress the visualizer that writes image/dataset.fits.
The aggregator then calls fit.value("dataset") and crashes on
None[0].header.
Pop PYAUTO_SKIP_VISUALIZATION and PYAUTO_SKIP_FIT_OUTPUT, and
downgrade PYAUTO_TEST_MODE>=2 to 1, before importing autofit. The
helper is idempotent (early-exits if output/ exists), so the cost is
paid once per workspace per smoke run.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
Four aggregator tutorial scripts (
scripts/guides/results/aggregator/data_fitting.pyandmodels.pyin bothautogalaxy_workspaceandautolens_workspace) crash withTypeError: 'NoneType' object is not subscriptableatPyAutoGalaxy/autogalaxy/aggregator/agg_util.py:101when run in fast smoke mode (PYAUTO_TEST_MODE=2 PYAUTO_SKIP_VISUALIZATION=1). The_quick_fit.pyhelper they invoke via subprocess inherits those env vars and skips the visualizer that writesimage/dataset.fits, so the downstreamfit.value("dataset")call returnsNone.This was Cluster A of the recent release-prep triage. The companion fix in
autolens_workspacecarries identical changes.Scripts Changed
scripts/guides/results/_quick_fit.py— popPYAUTO_SKIP_VISUALIZATIONandPYAUTO_SKIP_FIT_OUTPUT, downgradePYAUTO_TEST_MODE>=2to1, before importingautofit. Ensures the helper always produces a completeoutput/results_folder/(includingimage/dataset.fits) regardless of how the parent script was invoked. Idempotent early-exit means the cost is paid once per workspace per smoke run.Test Plan
data_fitting.pyandmodels.pyexit 0 underPYAUTO_TEST_MODE=2 PYAUTO_SKIP_FIT_OUTPUT=1 PYAUTO_SKIP_VISUALIZATION=1 PYAUTO_SKIP_CHECKS=1 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1(pre-fix:data_fitting.pyexits 1 with the documentedTypeError)🤖 Generated with Claude Code