docs(chapter_1): restore truncated tutorials + add completeness CI check#27
Merged
Merged
Conversation
tutorial_1_grids_and_galaxies and tutorial_2_ray_tracing were cut off mid-generation during the workspace bootstrap, each ending on a docstring that promised a plot with no code following and no Wrap Up (frozen at the truncated length since bootstrap commit #1; the original workspace source no longer exists). Restore the lost content: - tutorial_1: log10 image + __Galaxies__ + __Units__ + __Wrap Up__ + advanced topics, adapted from the complete HowToGalaxy sibling to the autolens API and lens framing (429 -> 672 lines). - tutorial_2: log-space convergence/potential + __Ray Tracing Grids__ (lens equation) + __Ray Tracing Images__ + __Galaxies__ + __Tracer__ + __Mappings__ + __Wrap Up__, sourced from guides/tracer.py (214 -> 391 lines). Both validated end-to-end and via the curated smoke suite (6/6). Prevent recurrence: add .github/scripts/check_tutorials_complete.py + a CI workflow that fails when any tutorial lacks a terminal __Wrap Up__/__Summary__ section — a truncated script never reaches its wrap-up, so absence of the marker reliably flags lost content. Normalize five complete-but-unmarked tutorials (tutorial_4_dealing_with_failure, tutorial_4_bayesian_regularization, tutorial_6_slam, tutorial_8_model_fit, tutorial_searches) with the terminal marker so they pass. Regenerate notebooks + navigator catalogue. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KExk2jkn2ya21b6NZLALpB
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.
Overview
Phase 1 (HowToLens) of #26. Two chapter-1 tutorials were cut off mid-generation
during the workspace bootstrap —
tutorial_1_grids_and_galaxiesandtutorial_2_ray_tracingeach ended on a docstring that promised a plot with nocode following and no Wrap Up, and had been frozen at the truncated length since
bootstrap commit #1 (the original workspace source no longer exists). This
restores the lost content and adds a CI check so the regression cannot silently
recur.
Root cause
Not a runtime bug — an LLM output-token cutoff while re-emitting a long file
during the bootstrap. Line counts had been frozen ever since (tutorial_1 at 429
vs the complete 654-line HowToGalaxy sibling).
What changed
log10image +__Galaxies__+__Units__+__Wrap Up__+ advanced topics, adapted from the completeHowToGalaxy sibling to the
autolensAPI and lens framing.__Ray Tracing Grids__(the lens equation) +__Ray Tracing Images__+__Galaxies__+__Tracer__+__Mappings__+__Wrap Up__, sourced fromguides/tracer.py..github/scripts/check_tutorials_complete.py+ theTutorials CompleteCI workflow — every non-stub tutorial must contain aterminal
__Wrap Up__/__Summary__section (a truncated script never reachesits wrap-up, so absence of the marker reliably flags lost content; a second
guard flags a final docstring ending on
:). Verified to catch the originaltruncation and pass the restored tree.
(
tutorial_4_dealing_with_failure,tutorial_4_bayesian_regularization,tutorial_6_slam,tutorial_8_model_fit,tutorial_searches) get theterminal marker so they pass the new check.
Deliberate
not written yetstubs (tutorial_4_point_sources,tutorial_5_lensing_formalism) already carry a__Wrap Up__and are correctlyleft untouched.
Scripts Changed
scripts/chapter_1_introduction/tutorial_1_grids_and_galaxies.py— restored truncated tail (log10 / Galaxies / Units / Wrap Up)scripts/chapter_1_introduction/tutorial_2_ray_tracing.py— restored truncated tail (ray-tracing grids / images / Galaxies / Tracer / Mappings / Wrap Up)scripts/chapter_2_lens_modeling/tutorial_4_dealing_with_failure.py— add__Wrap Up__marker (already complete)scripts/chapter_4_pixelizations/tutorial_4_bayesian_regularization.py— add__Wrap Up__marker (already complete)scripts/chapter_3_search_chaining/tutorial_6_slam.py— add__Wrap Up__marker (already complete)scripts/chapter_4_pixelizations/tutorial_8_model_fit.py— add__Wrap Up__marker (already complete)scripts/chapter_optional/tutorial_searches.py— add__Wrap Up__section (already complete).github/scripts/check_tutorials_complete.py— new tutorial-completeness linter.github/workflows/tutorials_complete.yml— new CI workflow running the linternotebooks/**,llms-full.txt,workspace_index.json— regeneratedValidation checklist (--auto)
smoke_tests.txt6/6 (including restored tutorial_1 & tutorial_2), run on this branch. Both restored scripts also run standalone end-to-end (EXIT 0).lines=/positions=overlay API it doesn't use).python .github/scripts/check_tutorials_complete.py .→ all 35 tutorials pass; confirmed it fails on the pre-restore truncated tutorial_1/tutorial_2.Phases 2–3 (HowToGalaxy, then HowToFit — same audit + restore + CI) follow as their own PRs. This PR does not close #26.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KExk2jkn2ya21b6NZLALpB