Overview
Extract the howtolens tutorial series out of autolens_workspace into its own standalone repo (Jammy2211/HowToLens, to be transferred to PyAutoLabs org). This is sub-task 1 of 3 — follow-up issues will (2) clean up autolens_workspace to remove the migrated content and update cross-references, and (3) update PyAutoLens docs/URLs to point at the new repo. The same pattern will later be applied to HowToGalaxy and HowToFit.
Plan
- Scaffold a fresh
HowToLens repo with the standard workspace layout (config/ dataset/ notebooks/ output/ scripts/).
- Copy
scripts/howtolens/* and notebooks/howtolens/* from autolens_workspace verbatim (fresh copy, no git history preservation). Flatten one level — whole repo is HowToLens, so strip the howtolens/ sub-folder.
- Copy supporting files (
config/, requirements.txt, runtime.txt) and author a fresh README.rst, CLAUDE.md, start_here.py, welcome.py, CITATIONS.rst, CODE_OF_CONDUCT.md, CONTRIBUTING.md, smoke_tests.txt.
- Commit zero
.fits files — tutorials already simulate their own datasets at runtime via scripts/simulator/*.py.
- Add CI workflows:
url_check.yml (same as autolens_workspace) and a smoke_tests.yml modeled on autolens_workspace_test, running the howtolens scripts under PyAuto fast/test-mode flags.
- Push to
Jammy2211/HowToLens, then gh repo transfer Jammy2211/HowToLens PyAutoLabs and accept on the org side.
Detailed implementation plan
Affected Repositories
- HowToLens (new, primary — Jammy2211/HowToLens → PyAutoLabs/HowToLens after push)
autolens_workspace and PyAutoLens are untouched by this sub-task — their cleanup lives in sibling issues (2) and (3).
Work Classification
Workspace (new workspace-style repo)
Branch Survey
| Repository |
Current Branch |
Dirty? |
| HowToLens |
(new) |
n/a — fresh clone into the task worktree |
Suggested branch: feature/howtolens-bootstrap
Worktree root: ~/Code/PyAutoLabs-wt/howtolens-bootstrap/ (created later by /start_workspace)
No overlap with other active tasks (smoke-test-optimization, jax-likelihood-multi-parity, searches-minimal) — none of them touch HowToLens.
Implementation Steps
-
Clone Jammy2211/HowToLens into the task worktree root. Confirm it's effectively empty (0 KB disk usage per gh repo view).
-
Create top-level folder structure:
HowToLens/
config/ # copy from autolens_workspace/config/
dataset/ # empty — tutorials generate .fits at runtime
notebooks/ # populated in step 4
output/ # .gitkeep only
scripts/ # populated in step 3
.github/workflows/
-
Copy scripts content — flatten one level:
autolens_workspace/scripts/howtolens/chapter_1_introduction/ → HowToLens/scripts/chapter_1_introduction/
- Same pattern for
chapter_2_lens_modeling/, chapter_3_search_chaining/, chapter_4_pixelizations/, chapter_optional/, simulator/.
- Update internal path references in scripts from
scripts/howtolens/simulator/... to scripts/simulator/....
- Update
dataset_path = Path("dataset") / "imaging" / "howtolens" → Path("dataset") / "imaging" (or keep sub-folder; decide during implementation to minimize script edits).
-
Copy notebooks content:
autolens_workspace/notebooks/howtolens/* → HowToLens/notebooks/* (flattened the same way).
- Ideally regenerate via PyAutoBuild
generate.py after the script edits in step 3 settle, rather than hand-editing .ipynb.
-
Copy supporting files from autolens_workspace and adapt:
config/ — copy whole tree.
requirements.txt, runtime.txt — copy as-is.
CITATIONS.rst, CODE_OF_CONDUCT.md, CONTRIBUTING.md — copy, update repo URL references.
welcome.py — copy and rewrite welcome text for HowToLens.
smoke_tests.txt — rewrite to list the howtolens smoke scripts.
.gitignore — copy from autolens_workspace.
-
Author new top-level README.rst by merging:
autolens_workspace/scripts/howtolens/README.rst (overview + chapter descriptions).
- Usage/installation sections adapted from
autolens_workspace/README.rst.
- A "Relationship to
autolens_workspace" section pointing users back to the main workspace.
-
Author CLAUDE.md modeled on autolens_workspace/CLAUDE.md, scoped to the HowToLens surface (chapter layout, build/test commands, PyAutoBuild integration).
-
Author start_here.py — short orientation script directing new users to scripts/chapter_1_introduction/tutorial_0_visualization.py.
-
CI: .github/workflows/url_check.yml — copy from autolens_workspace/.github/workflows/url_check.yml verbatim.
-
CI: .github/workflows/smoke_tests.yml — adapt autolens_workspace_test/.github/workflows/smoke_tests.yml:
- Checkout PyAutoConf/Fit/Array/Galaxy/Lens.
- Install with
[optional] extras on 3.12, numba-only on 3.13.
- Run the howtolens scripts via a
run_smoke.py runner under PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1 PYAUTO_DISABLE_JAX=1.
- Slack-notify on failure (same webhook pattern).
-
Smoke-test locally from the worktree root:
PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1 \
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib \
python scripts/chapter_1_introduction/tutorial_1_grids_and_galaxies.py
At minimum confirm chapter 1 tutorials import and run end-to-end.
-
First commit + push to Jammy2211/HowToLens on feature/howtolens-bootstrap, then open a PR against main (the repo is essentially empty, so this is effectively a seed PR).
-
After merge, run gh repo transfer Jammy2211/HowToLens PyAutoLabs and accept the transfer. Note: PyAutoLabs/HowToLens URLs start working only after acceptance — sub-tasks 2 and 3 should hard-code the post-transfer URL.
Key Files
HowToLens/README.rst — main landing page, new file
HowToLens/CLAUDE.md — agent instructions, new file
HowToLens/start_here.py — orientation script, new file
HowToLens/scripts/chapter_*/ — migrated from autolens_workspace/scripts/howtolens/chapter_*/
HowToLens/notebooks/chapter_*/ — migrated from autolens_workspace/notebooks/howtolens/chapter_*/
HowToLens/.github/workflows/url_check.yml — CI
HowToLens/.github/workflows/smoke_tests.yml — CI
Follow-up issues (do NOT handle here)
- Sub-task 2 (
autolens_workspace cleanup): remove scripts/howtolens/, notebooks/howtolens/, update all howtolens-referencing files (10+ Python scripts, README.rst, start_here.py/.ipynb, CLAUDE.md, config/build/*.yaml).
- Sub-task 3 (
PyAutoLens docs): update docs/index.rst toctree, howtolens/*.rst pages, README.rst, paper/paper.md, overview/overview_2_new_user_guide.rst, general/workspace.rst.
Original Prompt
Click to expand starting prompt
The howtolens jupyter notebook lectures are in autolens_workspace/scripts/howtolens (and notebook)
I want to make them their own GitHub repo, with their own continuous integration, following the same
folder parts (config / dataset / notebooks / output / scripts) as other workspaces. Can you do this?
I have set up the GitHub repo:
https://github.com/Jammy2211/HowToLens
I forgot to put HowToLens in the PyAutoLabs organisation so can you do that as well.
You also need to make sure:
- The repo is set up and populated with descriptions of HowToLens that can be takenf rom all the existing workspace stuff.
- That existing workspace stuff is updated to point to this repo, including URL updates.
After this task. we will perform identical work with HowToGalaxy and HowToFit:
https://github.com/Jammy2211/HowToGalaxy
https://github.com/Jammy2211/HowToFit
Feel free to break this take down into many subprompts
Overview
Extract the
howtolenstutorial series out ofautolens_workspaceinto its own standalone repo (Jammy2211/HowToLens, to be transferred toPyAutoLabsorg). This is sub-task 1 of 3 — follow-up issues will (2) clean upautolens_workspaceto remove the migrated content and update cross-references, and (3) updatePyAutoLensdocs/URLs to point at the new repo. The same pattern will later be applied to HowToGalaxy and HowToFit.Plan
HowToLensrepo with the standard workspace layout (config/ dataset/ notebooks/ output/ scripts/).scripts/howtolens/*andnotebooks/howtolens/*fromautolens_workspaceverbatim (fresh copy, no git history preservation). Flatten one level — whole repo is HowToLens, so strip thehowtolens/sub-folder.config/,requirements.txt,runtime.txt) and author a freshREADME.rst,CLAUDE.md,start_here.py,welcome.py,CITATIONS.rst,CODE_OF_CONDUCT.md,CONTRIBUTING.md,smoke_tests.txt..fitsfiles — tutorials already simulate their own datasets at runtime viascripts/simulator/*.py.url_check.yml(same asautolens_workspace) and asmoke_tests.ymlmodeled onautolens_workspace_test, running the howtolens scripts under PyAuto fast/test-mode flags.Jammy2211/HowToLens, thengh repo transfer Jammy2211/HowToLens PyAutoLabsand accept on the org side.Detailed implementation plan
Affected Repositories
autolens_workspaceandPyAutoLensare untouched by this sub-task — their cleanup lives in sibling issues (2) and (3).Work Classification
Workspace (new workspace-style repo)
Branch Survey
Suggested branch:
feature/howtolens-bootstrapWorktree root:
~/Code/PyAutoLabs-wt/howtolens-bootstrap/(created later by/start_workspace)No overlap with other active tasks (
smoke-test-optimization,jax-likelihood-multi-parity,searches-minimal) — none of them touch HowToLens.Implementation Steps
Clone
Jammy2211/HowToLensinto the task worktree root. Confirm it's effectively empty (0 KB disk usage pergh repo view).Create top-level folder structure:
Copy scripts content — flatten one level:
autolens_workspace/scripts/howtolens/chapter_1_introduction/→HowToLens/scripts/chapter_1_introduction/chapter_2_lens_modeling/,chapter_3_search_chaining/,chapter_4_pixelizations/,chapter_optional/,simulator/.scripts/howtolens/simulator/...toscripts/simulator/....dataset_path = Path("dataset") / "imaging" / "howtolens"→Path("dataset") / "imaging"(or keep sub-folder; decide during implementation to minimize script edits).Copy notebooks content:
autolens_workspace/notebooks/howtolens/*→HowToLens/notebooks/*(flattened the same way).generate.pyafter the script edits in step 3 settle, rather than hand-editing.ipynb.Copy supporting files from
autolens_workspaceand adapt:config/— copy whole tree.requirements.txt,runtime.txt— copy as-is.CITATIONS.rst,CODE_OF_CONDUCT.md,CONTRIBUTING.md— copy, update repo URL references.welcome.py— copy and rewrite welcome text for HowToLens.smoke_tests.txt— rewrite to list the howtolens smoke scripts..gitignore— copy from autolens_workspace.Author new top-level
README.rstby merging:autolens_workspace/scripts/howtolens/README.rst(overview + chapter descriptions).autolens_workspace/README.rst.autolens_workspace" section pointing users back to the main workspace.Author
CLAUDE.mdmodeled onautolens_workspace/CLAUDE.md, scoped to the HowToLens surface (chapter layout, build/test commands, PyAutoBuild integration).Author
start_here.py— short orientation script directing new users toscripts/chapter_1_introduction/tutorial_0_visualization.py.CI:
.github/workflows/url_check.yml— copy fromautolens_workspace/.github/workflows/url_check.ymlverbatim.CI:
.github/workflows/smoke_tests.yml— adaptautolens_workspace_test/.github/workflows/smoke_tests.yml:[optional]extras on 3.12, numba-only on 3.13.run_smoke.pyrunner underPYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1 PYAUTO_DISABLE_JAX=1.Smoke-test locally from the worktree root:
At minimum confirm chapter 1 tutorials import and run end-to-end.
First commit + push to
Jammy2211/HowToLensonfeature/howtolens-bootstrap, then open a PR againstmain(the repo is essentially empty, so this is effectively a seed PR).After merge, run
gh repo transfer Jammy2211/HowToLens PyAutoLabsand accept the transfer. Note:PyAutoLabs/HowToLensURLs start working only after acceptance — sub-tasks 2 and 3 should hard-code the post-transfer URL.Key Files
HowToLens/README.rst— main landing page, new fileHowToLens/CLAUDE.md— agent instructions, new fileHowToLens/start_here.py— orientation script, new fileHowToLens/scripts/chapter_*/— migrated fromautolens_workspace/scripts/howtolens/chapter_*/HowToLens/notebooks/chapter_*/— migrated fromautolens_workspace/notebooks/howtolens/chapter_*/HowToLens/.github/workflows/url_check.yml— CIHowToLens/.github/workflows/smoke_tests.yml— CIFollow-up issues (do NOT handle here)
autolens_workspacecleanup): removescripts/howtolens/,notebooks/howtolens/, update allhowtolens-referencing files (10+ Python scripts,README.rst,start_here.py/.ipynb,CLAUDE.md,config/build/*.yaml).PyAutoLensdocs): updatedocs/index.rsttoctree,howtolens/*.rstpages,README.rst,paper/paper.md,overview/overview_2_new_user_guide.rst,general/workspace.rst.Original Prompt
Click to expand starting prompt