Skip to content

fix: neutralize smoke-mode env vars in _quick_fit.py helper#60

Merged
Jammy2211 merged 1 commit intomainfrom
feature/quick-fit-smoke-mode-fix
May 7, 2026
Merged

fix: neutralize smoke-mode env vars in _quick_fit.py helper#60
Jammy2211 merged 1 commit intomainfrom
feature/quick-fit-smoke-mode-fix

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Four aggregator tutorial scripts (scripts/guides/results/aggregator/data_fitting.py and models.py in both autogalaxy_workspace and autolens_workspace) crash with TypeError: 'NoneType' object is not subscriptable 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 and skips the visualizer that writes image/dataset.fits, so the downstream fit.value("dataset") call returns None.

This was Cluster A of the recent release-prep triage. The companion fix in autolens_workspace carries identical changes.

Scripts Changed

  • scripts/guides/results/_quick_fit.py — pop PYAUTO_SKIP_VISUALIZATION and PYAUTO_SKIP_FIT_OUTPUT, downgrade PYAUTO_TEST_MODE>=2 to 1, before importing autofit. Ensures the helper always produces a complete output/results_folder/ (including image/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

  • Smoke tests pass for affected workspace
  • Verified locally: aggregator data_fitting.py and models.py exit 0 under PYAUTO_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.py exits 1 with the documented TypeError)

🤖 Generated with Claude Code

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]>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 7, 2026
@Jammy2211 Jammy2211 merged commit f6168bc into main May 7, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/quick-fit-smoke-mode-fix branch May 7, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant