Skip to content

docs: fix stale autolens_workspace self-location paths in tutorials and simulators - #82

Merged
Jammy2211 merged 4 commits into
mainfrom
feature/howto-stale-self-location
Sep 14, 2026
Merged

Jammy2211 merged 4 commits into
mainfrom
feature/howto-stale-self-location

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes part of PyAutoLabs/HowToGalaxy#75 (the HowToGalaxy half ships as its own PR; run /prm only after both are merged).

What this fixes

HowToLens was split out of autolens_workspace, but its prose was not. Tutorials and simulators still told the reader that their own dataset and output folders live inside autolens_workspace — a repo they may not even have cloned.

Scripts Changed

18 scripts, 31 prose lines (scripts/ only; notebooks/ is generated):

  • 14 lines / 9 scripts naming autolens_workspace/{output,dataset} — chapter_2_lens_modeling/ tutorials 2 and 3, and seven simulators (lens_x2, lens_x3, lens_sersic, lens_extra_galaxy, no_lens_light, no_lens_light__mass_sis, source_complex).
  • 17 lines / 9 more scripts saying checkout the workspace/output/... — the same defect without the repo name, pointing at a directory that does not exist here.

The 60 cross-references were deliberately left alone. Two classes of autolens_workspace reference exist and only one is stale: text saying where the reader's files are (fixed), versus text pointing at the sibling workspace's examples — SLaM, chaining, pixelization, data preparation (correct post-split, untouched).

Four paths were wrong beyond the repo name

Each was checked against the search's actual path_prefix/name rather than having the prefix stripped, which is what surfaced these:

File Was Now
tutorial_6_masking_and_positions.py:264 workspace/output/t7_with_positions — a leftover from when this was tutorial 7, and no chapter prefix output/howtolens/chapter_2/tutorial_6_with_positions
chapter_optional/tutorial_searches.py ×4 no path at all past workspace/output filled in from each search's own definition
no_lens_light__mass_sis.py:167 dataset simple__no_lens_light simple__no_lens_light__mass_sis (what the script writes)
tutorial_3_realism_and_complexity.py:207 output/3_realism_and_complexity output/howtolens/chapter_2/tutorial_3_realism_and_complexity__local_maxima

A plain prefix-strip would have shipped the first two still pointing at nothing.

One apparent truncation at tutorial_4_group_scale.py:608 was checked and not "fixed" — the path continues on the adjacent string literal, so a line-scoped regex would have corrupted it into a duplicated segment.

Path style

Uses this repo's existing bare relative form (output/..., dataset/...), matching the four simulators already corrected post-split and AGENTS.md's statement that scripts run from the repo root. The sibling HowToGalaxy PR uses a HowToGalaxy/-prefixed form because that is its existing house style; each repo stays internally consistent, which is what a reader of one repo actually sees.

markdown/ is unaffected

markdown/ is built by generate_markdown.py from config/build/markdown_examples.yaml, which curates only the nine chapter-1 tutorials — none of them touched here. grep over markdown/ for stale paths returns zero. So unlike the sibling HowToGalaxy PR there is nothing to rebuild and nothing left stale.

Verification

  • workspace/output remaining: 0 · autolens_workspace/{output,dataset,config} remaining: 0
  • autolens_workspace cross-references retained in scripts/: 60
  • Changed notebook basenames == changed script basenames (no foreign drift swept in)
  • llms-full.txt / workspace_index.json regenerated with no diff
  • All 18 edited scripts py_compile clean

Heart was YELLOW at ship time; the human acknowledged the exact reason set (autofit/autolens workspace-validation failures, A100 profiling drift, missing release rehearsal), none of which this change can affect. Recorded on the task's active.md entry.

Note for reviewers

This branch was taken as a deliberate parallel worktree alongside feature/model-figure-prose-lens. Three lines here land in files that branch has also touched — chapter_4_scaling_up_lensing/tutorial_1_extra_galaxies.py 246 and 429, and tutorial_2_multi_galaxy.py 324. All three are single-line print strings inside print(...) blocks following an af.Nautilus(...) construction, so a prose-focused branch should not collide, but those are the lines to check at merge.

Follow-up filed (not fixed here)

chapter_optional/tutorial_searches.py writes three of its four searches into output/howtolens/chapter_2/ instead of chapter_optional/ — a behavioural bug, out of scope for a prose PR. The four print strings here are truthful against the code as it stands, so a future fix to those path_prefix values must move this prose with it.

🤖 Generated with Claude Code

https://claude.ai/code/session_014ujQLXo85GNH7tG5eaNJ65

The HowTo series was split out of the *_workspace repos, but the prose did not
move with it: tutorials still told the reader that their dataset and output
folders live inside autolens_workspace.

Fixes self-location references only. The 60 cross-references pointing the reader
at the sibling workspace for further examples are correct post-split and are
untouched.

- 14 lines across 9 scripts naming autolens_workspace/{output,dataset}: two
  chapter-2 tutorials and seven simulators.
- 17 print strings across 9 more scripts saying "checkout the workspace/output/..."
  — the same defect without the repo name, naming a directory that does not
  exist in this repo.

Four paths were wrong beyond the repo name, and are corrected against the code
rather than string-swapped:

- tutorial_6_masking_and_positions.py named output/t7_with_positions, a leftover
  from when this was tutorial 7, and dropped the howtolens/chapter_2 prefix.
- tutorial_searches.py gave no path at all past workspace/output, in four
  places; filled in from each search's own path_prefix/name.
- no_lens_light__mass_sis.py named dataset simple__no_lens_light; the script
  writes simple__no_lens_light__mass_sis.
- tutorial_3_realism_and_complexity.py named output/3_realism_and_complexity;
  the search writes tutorial_3_realism_and_complexity__local_maxima under
  howtolens/chapter_2.

Uses this repo's existing bare relative-path style (`output/...`, `dataset/...`),
matching the four simulators already corrected post-split.

markdown/ is unaffected: its curated list covers only chapter 1, none of which
is touched here, and it already contains no stale paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ujQLXo85GNH7tG5eaNJ65
Jammy2211 and others added 3 commits September 14, 2026 22:41
The __Directories__ block states that the working directory must be the
HowToLens repository root, but never says where to get it. A reader who
does not already have the repo is left without a next step. It also omits
config/, which the same block in HowToFit and HowToGalaxy both name.

Adds the clone URL and the config/ mention, matching the __Paths__ block
HowToFit's tutorial 1 already carries. This is the same defect, in the
other spelling, that this branch fixes elsewhere: prose written when these
tutorials still lived inside autolens_workspace and the reader was assumed
to have it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ujQLXo85GNH7tG5eaNJ65
tutorial_searches.py defines four searches; three wrote their results to
output/howtolens/chapter_2/ instead of chapter_optional/, apparently
copy-pasted from whichever chapter 2 tutorial they were adapted from. A
reader working through the optional chapter found most of its results
filed under chapter 2.

The four print strings naming these paths are updated in the same commit.
They were corrected earlier on this branch to match the code as it stood,
so changing the path_prefix without them would re-break them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ujQLXo85GNH7tG5eaNJ65
Regenerates markdown/chapter_1_introduction/tutorial_0_visualization.md,
the curated page for the tutorial whose __Directories__ block gained the
clone URL and config/ mention in the previous commit.

Kept separate so that prose change reads as a one-block addition. This
commit also carries the catch-up the page had accumulated since it was
last built: the workspace version-check warnings no longer appear (the
render sets PYAUTO_SKIP_WORKSPACE_VERSION_CHECK=1), the convolver warning
moved line number with PyAutoArray, and the four figures are re-rendered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ujQLXo85GNH7tG5eaNJ65
@Jammy2211
Jammy2211 merged commit bf0ca77 into main Sep 14, 2026
7 checks passed
@Jammy2211
Jammy2211 deleted the feature/howto-stale-self-location branch September 14, 2026 22:03
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.

1 participant