Skip to content

chapter 3: drop internal evidence-scan checks; run smoke on small datasets - #131

Merged
Jammy2211 merged 1 commit into
mainfrom
ccr-eef5e2b2-t0z1tp
Nov 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
ccr-eef5e2b2-t0z1tp

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Why

chapter_3_pixelizations/tutorial_5_fit_problems.py and tutorial_6_adaptive_reconstruction.py are the two slowest HowToLens smoke scripts (60.3s and 67.7s on CI, about half the leg). They declared ENV: full_datasets only because their internal raise ValueError checks (evidence scan non-finite, or peak at the edge of the coefficient range) fail at the small-dataset size. Those checks aren't lesson content, so the maintainer chose to remove them rather than pay for full-size data in every PR.

Change

  • Remove the raise ValueError guards (bracket and non-finite).
  • tutorial_5's refinement step now clamps its neighbours (max(best_index - 1, 0) / min(best_index + 1, len - 1)), so a peak at the grid edge refines inward instead of raising IndexError. At full size the peak is interior, so behaviour is unchanged.
  • Remove the __Env__ / ENV: full_datasets sections, so the smoke gate runs these on small datasets like the rest of the chapter. Users still run them at full size.
  • Scripts only. Notebooks regenerate at the next pre-build, per AGENTS.md.

Verification (local, py3.12, smoke env)

Script small (CI now) full size (users)
tutorial_5_fit_problems 12.2s ✅ 98.0s ✅
tutorial_6_adaptive_reconstruction 18.6s ✅ 76.8s ✅

The resolved smoke env now gives PYAUTO_SMALL_DATASETS=1 for both. The same change is in HowToGalaxy (tutorials 3 and 4).

Note: this PR's smoke CI uses the same-named library branches, and PyAutoArray ccr-eef5e2b2-t0z1tp exists (PyAutoArray#679, curvature compile reuse), so CI here also exercises that branch.


Generated by Claude Code

…asets

The fit-problems and adaptive-reconstruction tutorials raised ValueError
when an evidence scan was non-finite or peaked at the edge of its
coefficient range. Those are developer checks, not lesson content, and
they were the only reason the two tutorials declared `ENV: full_datasets`.
At the small-dataset size the scans peak at the range edge, so the checks
failed there.

- Remove the `raise ValueError` guards (bracket and non-finite).
- The fit-problems refinement step now clamps its neighbours, so a peak
  at the grid edge refines inward instead of indexing past the grid. At
  full size the peak is interior and behaviour is unchanged.
- Remove the `__Env__` / `ENV: full_datasets` sections, so the smoke gate
  runs these tutorials on small datasets like the rest of the chapter.
  Users still run them at full size, since PYAUTO_SMALL_DATASETS is unset
  for them.

Measured locally (py3.12, smoke env), both tutorials end to end:
  HowToLens:   tutorial_5 98.0s -> 12.2s, tutorial_6 76.8s -> 18.6s
  HowToGalaxy: tutorial_3 81.9s ->  7.2s, tutorial_4 68.0s -> 11.4s
Both also run end to end at full size.

Notebooks regenerate at the next pre-build (scripts are the source).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8McPUvDThp9s9JAiZz
@Jammy2211
Jammy2211 merged commit c0c80e1 into main Nov 8, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the ccr-eef5e2b2-t0z1tp branch November 8, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants