Skip to content

Revise Chapter 2 lens modelling tutorials and search chaining - #124

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/howtolens-ch2-explanations
Nov 4, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/howtolens-ch2-explanations

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Chapter 2 now builds from explicit likelihood functions and parameter-space intuition to reusable dataset/likelihood interfaces and component-based search chaining. Linear light profiles are introduced in Tutorial 4, after the first three lessons have established ordinary profile fitting and the challenges of local maxima.

Tutorial 5 explains why the examples use circular masks, demonstrates a fast positions penalty with lens light, and shows how the same model-composition API applies across datasets. Tutorial 6 chains Prodigy and Nautilus, distinguishes optimisation from uncertainty estimation, fixes selected lens-light geometry, and introduces SLaM. Runtime guidance and runnable model_centred prior passing are optional lessons.

Scripts Changed

  • scripts/chapter_2_lens_modeling/tutorial_1_non_linear_search.py, tutorial_2_practicalities.py, tutorial_3_why_modeling_is_hard.py — restore explicit parameter-space functions and physical interpretation; defer linear profiles; explain local maxima, search effort and alternative methods.
  • scripts/chapter_2_lens_modeling/tutorial_5_data_and_likelihoods.py — replace mask-choice exercises with the circular-mask rationale, one annular comparison image, positions-constrained fitting, noise scaling and dataset/model/likelihood separation.
  • scripts/chapter_2_lens_modeling/tutorial_6_search_chaining.py — use a 15-parameter Prodigy fit followed by a 12-parameter Nautilus fit; explain fixed geometry, automatically derived positions and conditional uncertainties.
  • scripts/chapter_2_lens_modeling/tutorial_7_summary.py — add the updated summary as a generated notebook.
  • scripts/chapter_optional/tutorial_need_for_speed.py, tutorial_prior_passing.py — update JAX/batching/runtime guidance and demonstrate supported prior transfer with result.model_centred, including the correct centres and width semantics.
  • Remove the redundant standalone Results and SLaM lessons; their material is covered in Tutorials 2 and 6. Update chapter numbering, READMEs, navigator links, notebooks and catalogues.

Validation

  • Full Heart-managed HowToLens shipping smoke: 42 passed, no failures.
  • Notebook/catalogue generation: 43 passed; navigation, syntax and whitespace checks passed.
  • Chapter 2 and optional smoke suite: 10 passed; restored runnable prior-passing lesson also passed its scoped smoke.
  • Full-resolution controlled checks verified positions geometry, noise scaling and the search-chain model composition, including 45 linear intensities and 15 → 12 non-linear parameters.
  • Controlled Result/SamplesSummary validation verified 11 centred priors, posterior-median centres, positive widths, fixed/shared parameters and actual second-model transfers (11 → 17 parameters).
  • Smoke uses the repository's test mode. These checks do not demonstrate optimisation or posterior convergence.

Heart acknowledgement

Heart reported YELLOW on 2026-11-04:

  • workspace validation not passing (0 failed, 1 timeout, cloud#41432188469: autofit_test scripts/searches/MultiStartResumeNaNCounters.py)
  • release validation incomplete: no rehearsal for current source

The user explicitly authorised development shipping despite these warnings: "yes go ahead, push chapter 2 and open the PR despite those warnings". This authorisation covers pushing and opening this PR; merge remains separate.

Closes #123.

Generated by the PyAutoLabs agent workflow.

Keep intensities in the non-linear search until Tutorial 4. Restore explicit likelihood functions and physical intuition, clarify local-maxima investigations and point to alternative searches.

Agent: Codex; model: GPT-6
Apply the approved Tutorial 5 review: circular masking, verified positions and a single constrained fit, noise scaling, and the shared model composition API across datasets. Include the comparison figure and regenerated notebook/catalogue.

Agent: Codex; model: GPT-6
Replace prior-passing lesson with approved Prodigy-to-Nautilus MGE chain, fixed lens-light geometry, free power-law mass slope and automatic positions. Explain conditional uncertainty and regenerate the notebook and catalogue.

Agent: Codex; model: GPT-6
@Jammy2211
Jammy2211 merged commit a7bd32c into main Nov 4, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/howtolens-ch2-explanations branch November 4, 2026 08:58
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.

docs: restore Chapter 2 modeling explanations

1 participant