Skip to content

refactor: remove howtolens subtree from autolens_workspace #79

@Jammy2211

Description

@Jammy2211

Overview

Sub-task 2 of 3 following up on #78. The howtolens tutorial series now lives in its own repo at PyAutoLabs/HowToLens (bootstrap shipped 2026-04-21 via PyAutoLabs/HowToLens#1). This task removes the now-duplicate content from autolens_workspace and rewires the surviving cross-references to point at the new repo.

Plan

  • Delete scripts/howtolens/ and notebooks/howtolens/ wholesale from autolens_workspace.
  • Fix the three scripts/guides/ scripts that auto-simulate their dataset by invoking scripts/howtolens/simulator/lens_sersic.py as a subprocess — they'd break when howtolens goes. Either relocate the simulator into autolens_workspace's own simulator layout or switch the guides to a shipped dataset.
  • Slim the "HowToLens" sections of README.rst and start_here.py down to a short pointer paragraph + link to the new repo.
  • Rewrite remaining howtolens URL references inside other autolens_workspace scripts/notebooks (e.g. scripts/imaging/modeling.py, interferometer/modeling.py, group/modeling.py) to point at github.com/PyAutoLabs/HowToLens.
  • Drop howtolens-keyed entries from config/build/env_vars.yaml and config/build/no_run.yaml.
  • PyAutoLens-side docs (docs/howtolens/, docs/overview/, docs/general/workspace.rst, paper.md, etc.) are explicitly deferred to sub-task 3 (docs-update).
Detailed implementation plan

Affected Repositories

  • autolens_workspace (primary, PyAutoLabs/autolens_workspace)

Work Classification

Workspace

Branch Survey

Repository Current Branch Dirty?
./autolens_workspace main clean (one stray untracked path/ dir, unrelated)

Suggested branch: feature/howtolens-workspace-cleanup
Worktree root: ~/Code/PyAutoLabs-wt/howtolens-workspace-cleanup/ (created later by /start_workspace)

Implementation Steps

  1. Delete howtolens contentgit rm -r scripts/howtolens notebooks/howtolens.

  2. Fix scripts/guides/ simulator subprocess dependency — three callers reference scripts/howtolens/simulator/lens_sersic.py:

    • scripts/guides/data_structures.py:247
    • scripts/guides/plot/examples/plotters.py:70
    • scripts/guides/plot/advanced/plotters_pixelization.py:59

    Decision to make at /start_workspace time:

    • Option A: move scripts/howtolens/simulator/lens_sersic.py into autolens_workspace (probably scripts/imaging/simulators/lens_sersic.py or a new scripts/simulator/ area) and rewrite the subprocess paths. Preserves feature parity with existing guide outputs.
    • Option B: retarget the three guides onto an already-shipped dataset (e.g. simple__no_lens_light, which already exists under dataset/imaging/). Simpler but may change the visuals those tutorials produce.

    Recommendation: Option A — the lens_sersic dataset is specifically a lens with Sersic light profile, and the guides illustrate plotting of that scenario. Preserving it keeps those guides' outputs stable.

  3. README.rst slim-down (autolens_workspace root, ~L12, L41-57, L79) — replace the HowToLens description block with ~2 sentences pointing at the standalone repo. Link: https://github.com/PyAutoLabs/HowToLens.

  4. start_here.py slim-down (~L376-391) — replace the HowToLens lecture pitch with a one-paragraph pointer. Regenerate start_here.ipynb via the standard notebook generation step (or let /pre_build handle it later).

  5. Cross-reference rewrites — the survey flagged notebook-body mentions in:

    • notebooks/imaging/modeling.ipynb:853
    • notebooks/interferometer/modeling.ipynb:710
    • notebooks/group/modeling.ipynb:992

    These are auto-generated; edit the corresponding .py scripts instead. Rewrite prose like "checkout autolens_workspace/*/howtolens" to point at github.com/PyAutoLabs/HowToLens.

  6. Build config cleanup:

    • config/build/env_vars.yaml:38-39 — remove the pattern: "howtolens/" override.
    • config/build/no_run.yaml:20,25,52-54 — remove howtolens-keyed skip entries.
  7. Smoke test — autolens_workspace's existing smoke_tests.txt does not list howtolens scripts, so no list changes expected. Run /smoke-test autolens_workspace after the edits to confirm nothing regressed. Then manually exercise the three fixed scripts/guides/ scripts with PYAUTO_TEST_MODE=2.

Key Files

  • scripts/howtolens/ — delete
  • notebooks/howtolens/ — delete
  • scripts/guides/data_structures.py — fix subprocess call
  • scripts/guides/plot/examples/plotters.py — fix subprocess call
  • scripts/guides/plot/advanced/plotters_pixelization.py — fix subprocess call
  • scripts/imaging/simulators/lens_sersic.py (new) — relocated simulator, if Option A
  • README.rst — slim HowToLens section
  • start_here.py — slim HowToLens pitch
  • scripts/imaging/modeling.py, scripts/interferometer/modeling.py, scripts/group/modeling.py — URL cross-refs
  • config/build/env_vars.yaml, config/build/no_run.yaml — remove howtolens entries

Out of Scope

PyAutoLens library-side docs updates (sub-task 3: howtolens-docs-update) — index.rst, docs/howtolens/*.rst, docs/overview/*.rst, docs/general/workspace.rst, paper.md, README.rst in the PyAutoLens repo.

Original Prompt

Click to expand starting prompt

Sub-task 2 of 3 following up on #78.

The howtolens tutorial series has been extracted into its own repo at PyAutoLabs/HowToLens (bootstrap PR: PyAutoLabs/HowToLens#1, shipped 2026-04-21).

This sub-task removes the howtolens content from PyAutoLabs/autolens_workspace and updates all internal cross-references that still point at scripts/howtolens/ or notebooks/howtolens/.

In scope

  • Delete scripts/howtolens/ and notebooks/howtolens/ (wholesale).
  • Fix the three scripts/guides/ callers that subprocess.run into scripts/howtolens/simulator/lens_sersic.py — they'll break when howtolens goes: scripts/guides/data_structures.py:247, scripts/guides/plot/examples/plotters.py:70, scripts/guides/plot/advanced/plotters_pixelization.py:59. Pick one of: (a) copy the simulator out of howtolens into scripts/imaging/simulators/ and update subprocess paths; (b) switch the guides to an already-shipped dataset like simple or simple__no_lens_light.
  • Slim the HowToLens sections in autolens_workspace/README.rst (~L12, L41-57, L79) and autolens_workspace/start_here.py (~L376-391) — regenerate matching .ipynb. Replace the embedded content with a short pointer paragraph + a link to https://github.com/PyAutoLabs/HowToLens.
  • Update the howtolens-referencing prose in other workspace scripts/notebooks (cross-refs in scripts/imaging/modeling.py, scripts/interferometer/modeling.py, scripts/group/modeling.py, etc.) to point at the new repo URL rather than autolens_workspace/*/howtolens.
  • Remove the howtolens-keyed entries from config/build/env_vars.yaml and config/build/no_run.yaml (they have no targets to apply to anymore).

Out of scope — sub-task 3

Changes to PyAutoLens/docs/ (index.rst toctree, howtolens/*.rst, overview/*.rst, general/workspace.rst, README.rst, paper.md). These live in the PyAutoLens library repo, not the workspace — deferred to sub-task 3 (howtolens-docs-update).

Validation

  • Smoke list: after the edits, run /smoke-test on autolens_workspace (its existing smoke_tests.txt — no howtolens scripts are currently listed there, so no list edits expected, but confirm).
  • Manually run the three scripts/guides/ callers to confirm the subprocess fix works.

Follow-up

Sub-task 3 (docs-update) will replace the PyAutoLens-side docs that still describe howtolens as an autolens_workspace/howtolens/ subtree. HowToGalaxy + HowToFit get the same three-step treatment once HowToLens is fully bedded in.

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