Skip to content

fix: add auto-simulate guards to unguarded dataset loads - #65

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/missing-auto-simulate-guards
Aug 3, 2026
Merged

fix: add auto-simulate guards to unguarded dataset loads#65
Jammy2211 merged 2 commits into
mainfrom
feature/missing-auto-simulate-guards

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Part of PyAutoLabs/autolens_workspace#455

Summary

chapter_4_pixelizations/tutorial_3_inversions.py is one of the 4 missing-dataset smoke failures from PyAutoHeart run 30790463134FileNotFoundError: dataset/imaging/source_complex/data.fits. Reproduced on a clean checkout before any edit (this repo ships no dataset/ directory at all, so the reproduction conditions were genuine).

The paired simulator already existed. The fix is an auto-simulate guard.

Root cause shape

The script already carried a correct guard at :49 — for its first dataset, simple__no_lens_light. The source_complex block further down at :152-158 had none. Same shape as the two autolens_workspace failures in the companion PR: a second dataset load that nobody guarded.

Scripts Changed

Script Change
scripts/chapter_4_pixelizations/tutorial_3_inversions.py ★ guard on the 2nd dataset (source_complex) → scripts/simulator/source_complex.py
scripts/chapter_4_pixelizations/tutorial_5_borders.py guard on the 2nd dataset (x2_lens_galaxies) → scripts/simulator/lens_x2.py

★ = the reported smoke failure.

tutorial_5_borders.py stays no_run for its own unrelated reason ("Cant get right masks, need proper update"), but its second dataset load had the identical missing guard and it is correct either way.

After this branch, zero unguarded dataset loads remain in this repo.

Validation

tutorial_3_inversions.pyEXIT 0 in 19s under its real smoke env, built via autohands.env_config.build_env_for_script against config/build/profile_smoke.yaml rather than hand-set variables. That env sets PYAUTO_SMALL_DATASETS=1, which makes should_simulate rmtree and re-simulate, so the guard was genuinely exercised rather than skipped over pre-existing data. The guard created exactly the file from the original traceback, dataset/imaging/source_complex/data.fits.

Not verified by execution: tutorial_5_borders.py is no_run. Its guard uses the same idiom and is syntax- and import-checked, but was not run.

Notebooks regenerated with generate.py howtolens.

Ship gate

Heart red at ship time (2026-08-03T17:44:16Z). Shipped under the corrective-PR exception, human-authorized in session, scoped to the YELLOW reason "workspace validation not passing (19 failed, 1 timeout, cloud#30790463134: …)" — the run this task was filed from. None of the three RED reasons relate to this change. The exception permits commit/push/PR-open only — merge and release stay human.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits August 3, 2026 19:05
chapter_4_pixelizations/tutorial_3_inversions.py is one of the 4 missing-dataset
smoke failures from PyAutoHeart run 30790463134 (FileNotFoundError on
dataset/imaging/source_complex/data.fits), reproduced on a clean checkout before
any edit.

The script already carried a correct guard at L49 for its FIRST dataset
(simple__no_lens_light); the source_complex block further down had none. Guarded
against the existing scripts/simulator/source_complex.py.

tutorial_5_borders.py gets the same treatment for dataset/imaging/
x2_lens_galaxies (scripts/simulator/lens_x2.py). It stays no_run for its
unrelated mask reason, but the guard is correct either way.

Verified: tutorial_3_inversions EXIT 0 in 19s under the real smoke env built via
autohands.env_config.build_env_for_script. PYAUTO_SMALL_DATASETS=1 makes
should_simulate rmtree and re-simulate, so the guard was genuinely exercised.
tutorial_5_borders is not verified by execution (no_run).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 3, 2026
@Jammy2211
Jammy2211 merged commit 2546f18 into main Aug 3, 2026
7 of 9 checks passed
@Jammy2211
Jammy2211 deleted the feature/missing-auto-simulate-guards branch August 3, 2026 21:40
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