Skip to content

docs: simplify the model figure prose to two fixed paragraphs #156

Closed

Description

@Jammy2211

Overview

Phase 6 of the model-figures epic put af.ModelPlotter(model).figure() beside every bare print(model.info), and every first figure site in a script carries a map/legend opener plus a paragraph of figure-specific reading commentary ("the lens · Galaxy card subtitled redshift = 0.5 holding …"). The human's verdict (2026-09-14) is that this is information overload and the figure should be self-explanatory. Every such block collapses to two fixed paragraphs, with all file-specific trailing prose deleted.

141 blocks are landed across 8 repos. This issue covers the six unclaimed repos (41 files). autolens_workspace and HowToLens (100 files) are handled by resuming the in-flight model-figures-rollout-lens task (autolens_workspace#542), whose wave 2 is stalled with 13 uncommitted blocks and ~53 sites still unwritten — it adopts the same new standard.

Plan

  • Replace the whole prose block — opener sentence, map/legend paragraph and every file-specific paragraph after it — with two fixed paragraphs, at all 18 .py sites in autofit_workspace, HowToFit and autogalaxy_workspace.
  • Apply the same replacement by hand to the 5 library-docs .md pages in PyAutoFit, PyAutoGalaxy and PyAutoLens, which carry image directives and code fences around the prose.
  • Leave the short one-to-three-line notes at second and third figure sites alone — only the opener block is in scope.
  • Regenerate the 18 notebook twins from the scripts; never text-edit a notebook.
  • Verify by coverage grep (no **map** / **legend** / "drawn as a figure" left), headless runs of every touched script under the smoke env profile, and an unchanged sphinx warning count on the three library repos.
  • Ship as three workspace PRs and three docs-only library PRs.
Detailed implementation plan

Affected Repositories

  • autofit_workspace (primary) — 11 .py + 11 .ipynb
  • HowToFit — 6 .py + 6 .ipynb
  • autogalaxy_workspace — 1 .py + 1 .ipynb
  • PyAutoFit — 3 .md (docs/cookbooks/{model,multi_level_model,multiple_datasets}.md)
  • PyAutoGalaxy — 1 .md (docs/general/model_cookbook.md)
  • PyAutoLens — 1 .md (docs/general/model_cookbook.md)

Branch Survey

Repository Current Branch Dirty?
./autofit_workspace main clean
./HowToFit main clean
./autogalaxy_workspace main clean
./PyAutoFit main clean
./PyAutoGalaxy main clean
./PyAutoLens main clean

Suggested branch: feature/model-figure-prose-simplify

Claim waiver: worktree_check_conflict fires on autofit_workspace, HowToFit and PyAutoFit, all claimed by task howtofit-mode (autofit_assistant#42, worktree .worktrees/howtofit-mode). That task's entire scope in those three repos is one uncommitted README.md each and no commits ahead of origin/main; this task touches only scripts/, notebooks/ and docs/cookbooks/, so the file sets are disjoint. Waived in a fresh parallel worktree based on origin/main, the same call recorded for sed-chain-cpu-route and sersic-variants-analysis. Note also that worktree_check_conflict returned a false clean when passed all six repos in one call and only fired when passed them one at a time — check per repo.

Canonical replacement text

The same model can also be visualized as a figure, making its structure easier to understand at a glance.

The figure shows how the model is organized: which parameters belong to each component, and whether they are free,
fixed, shared, linked by an expression, solved during the fit, or not configured. `model.info` provides the
corresponding numerical details, including the prior assigned to each free parameter and the value of each fixed
parameter.

model.info is backticked (human-confirmed); line wrapping and trailing-space style follow the surrounding file.

Implementation Steps

  1. Script blocks (18 files). Every .py block is structurally uniform — verified across all 88 landed script blocks in the workspace: a column-0 """ opens, at most three lines of opener prose follow, then the The figure is the **map** paragraph, then file-specific trailing prose, then """, then a *Plotter(...).figure() call. No block contains a __Section__ header and none is followed by anything but a plotter call. Identify each block by the **map** paragraph (not the opener — there are ~16 opener variants, including the long HowToFit "two views of the same model … division of labour" form) and replace from the docstring opener through the line before the closing """.
  2. Library-docs .md (5 files). Replace the map/legend paragraph with the canonical text and delete the figure-reading commentary after it, stopping at the next markdown heading. Delete the explicit map-to-model.info contract sections, the nesting-tint note and the plate-badge-vs-shared-badge note in the two model_cookbook.md pages — the same overload in reference form. Keep the Setting model_figure: true in a workspace's config/output.yaml sentence in PyAutoFit/docs/cookbooks/model.md (setup information, not figure commentary). PyAutoFit/docs/cookbooks/multiple_datasets.md keeps its {image} directive and af.ModelPlotter(...) code fence; only the prose changes.
  3. Notebooks. PYTHONPATH=../PyAutoHands/autohands python3 ../PyAutoHands/autohands/generate.py <key> from each workspace root; commit only touched twins plus llms-full.txt / workspace_index.json if rewritten; check_navigator.py must pass.
  4. Verification. Coverage grep for zero remaining is the **map** / is its **legend** / drawn as a figure; the canonical first sentence present exactly once per previously-matching file. Headless run of every touched script from its repo root under PYAUTO_TEST_MODE=1 PYAUTO_SKIP_FIT_OUTPUT=1 PYAUTO_SKIP_VISUALIZATION=1 PYAUTO_SKIP_CHECKS=1 PYAUTO_SKIP_API_GATE=1 MPLBACKEND=Agg with the worktree activate.sh sourced, exit 0 and no traceback; scripts in config/build/no_run.yaml are edited but not run and listed as "edited, not runnable" in the PR body. Sphinx warning count on the three library repos equals the baseline built on main in the same env.
  5. Line endings. HowToFit/scripts/chapter_1_introduction/tutorial_1_models.py is CRLF — preserve it. Do not touch config/priors/*.yaml (also CRLF).
  6. Ship. ship_workspace for the three workspace repos, ship_library for the three library repos (docs-only, pending-release). PR body ## Scripts Changed by folder; no ## API Changes.

Key Files

  • autofit_workspace/scripts/cookbooks/{model,multi_level_model,multiple_datasets,result}.py and scripts/features/*.py, scripts/overview/overview_1_the_basics.py, scripts/searches/start_point.py — 11 blocks
  • HowToFit/scripts/chapter_1_introduction/*.py, scripts/chapter_advanced/*.py — 6 blocks
  • autogalaxy_workspace/scripts/guides/modeling/cookbook.py — 1 block
  • PyAutoFit/docs/cookbooks/*.md, PyAutoGalaxy/docs/general/model_cookbook.md, PyAutoLens/docs/general/model_cookbook.md — 5 blocks

Original Prompt

Click to expand starting prompt

Replace this text everywhere:

The same model can also be drawn as a figure, which shows its structure at a glance.

The figure is the map and model.info is the legend. The map shows the shape of the model: which component
owns which parameter, and what state every parameter is in (free, fixed, shared with another component, related to
one by an expression, solved during the fit or missing from your configuration). The legend gives the numbers: the
prior on every parameter and the value of every fixed one.

WITH:

The same model can also be visualized as a figure, making its structure easier to understand at a glance.

The figure shows how the model is organized: which parameters belong to each component, and whether they are free,
fixed, shared, linked by an expression, solved during the fit, or not configured. model.info provides the corresponding
numerical details, including the prior assigned to each free parameter and the value of each fixed parameter.

Also remove all text and paragraphs after this one, for example:

"The map here is the two planes of the lens system: the lens · Galaxy card subtitled redshift = 0.5 holding
bulge · Sersic, mass · Isothermal and shear · ExternalShear, and the source · Galaxy card subtitled
redshift = 1.0 holding bulge · SersicCore. centre and ell_comps are badged 2D because each is a tuple of
two free parameters, and the greyed radius_break, gamma and alpha pills on the source are fixed values, which
is the difference between the footer's count of sampled scalars and the number of pills drawn."

Imo, this is informaiton overload and the figure should be self explantory. Do this across all repos, HowTo's etc. This is prob gonna over a lot of scripts, HowTo, workspaces etc

Activity

  1. Jammy2211 commented on Sep 14, 2026

    @Jammy2211
    CollaboratorAuthor

    PRs opened

    PyAutoFit: PyAutoLabs/PyAutoFit#1627
    PyAutoGalaxy: PyAutoLabs/PyAutoGalaxy#617
    PyAutoLens: PyAutoLabs/PyAutoLens#738
    autofit_workspace: #158
    HowToFit: PyAutoLabs/HowToFit#56
    autogalaxy_workspace: PyAutoLabs/autogalaxy_workspace#241

  2. Jammy2211 commented on Sep 14, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    All six PRs merged 2026-09-14. Every branch verified merged into origin/main with git branch -r --merged, not just by PR state.

    Repo PR Merged
    PyAutoFit #1627 yes
    PyAutoGalaxy #617 yes
    PyAutoLens #738 yes
    autofit_workspace #158 yes
    HowToFit #56 yes
    autogalaxy_workspace #241 yes

    29 source files and 21 regenerated notebooks. Every af.ModelPlotter prose block collapsed to the two fixed paragraphs, and the figure-rendering vocabulary (pills, plates, badges, greyed, footer counts) stripped from the shorter notes at later figure sites.

    Kept deliberately: 15 teaching sentences that had been mixed into figure commentary (parameter-space dimensionality in three HowToFit tutorials, the multi-level hierarchy rationale, the shared-centre-makes-it-graphical point, the linear-profile intensity fact); the EP factor-graph blocks, where box/pill/edge is standard PGM notation and the state overlay carries what graph.info does not; and image :alt: text, since describing a figure is its purpose.

    Verification: end-to-end gate clean across scripts, notebooks and docs; 18/18 runnable scripts exit 0 with 3 correctly skipped per no_run.yaml; sphinx 30/102/131 equal to a main baseline built in the same environment.

    Two notes for the record:

    • The recorded sphinx baselines for PyAutoGalaxy (105) and PyAutoLens (134) are stale — main itself builds 102 and 131 in this environment.
    • Scope grew past the original census: **map** wraps across a line break in two HowToFit tutorials, and tutorial_4_hierachical_models.py had a first-figure block with no map/legend paragraph at all. A whitespace-flattened search is required; a line-based grep misses them.

    Heart was YELLOW at ship time (9 pre-existing reasons, none touching files this work changes) and the human acknowledged it.

    The same standard was applied to autolens_workspace and HowToLens under PyAutoLabs/autolens_workspace#542.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions