Skip to content

docs: Lenstool example on the canonical CSV API end to end (stacked on #250) - #252

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/csv-api-lenstool
Jul 9, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/csv-api-lenstool

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #250 (merge that first; this PR then shows only its own commit). Companion to PyAutoLabs/PyAutoGalaxy#491 (issue PyAutoLabs/PyAutoGalaxy#490).

The Lenstool example now runs on the canonical CSV API end to end — the user directive that a Lenstool user should learn the PyAutoLens interface while feeling at home:

  • data.py writes the published Mahler et al. model as one canonical mass.csv: 149 rows of profile_class = dPIEMassLenstool whose columns are the .par keywords verbatim (sigma, r_core, r_cut, ellipticity, angle_pos) plus the run's redshifts and H0/Om0 — the .par file as a table. The member catalogue becomes members.csv in the galaxy_table schema with ellipticity/angle_pos/mag property columns.
  • modeling.py loads everything through al.galaxy_models_from_csv / al.galaxies_from_csv_tables (reconstruction: one call for all 149 components) and al.galaxy_af_models_from_csv_tables (refit: the named halos start as af.Models straight from the CSV, with input.par's priors promoted on top) — the bespoke rows_from_csv reader is deleted.
  • csv_api.py documents the Lenstool-parameterized rows, light-variant qualified names, table properties, and the new loud guards.

Parity re-verified after the port: 0.0680″ median source-plane rms — identical to pre-port, and the refit composes at the same 72 parameters.

Scripts Changed

  • Modified: scripts/cluster/lenstool/{data,modeling}.py, scripts/cluster/csv_api.py (+ catalogue regen).

Merge order

  1. autolens_workspace#250 → 2. PyAutoGalaxy#491 → 3. this.

Validation checklist (--auto run)

  • Human: merge in the order above

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits July 9, 2026 12:14
…er scripts

cluster/{modeling,start_here}.py: manual three-file existence guards ->
al.util.dataset.should_simulate (imaging convention; carries small-mode
delete-and-regenerate). lenstool/data.py: 96 MB mosaic/cutout leg skipped
under PYAUTO_SMALL_DATASETS=1 (visualization-only product). lenstool/
modeling.py: the 72-param refit runs only under LENSTOOL_EXAMPLE_RUN_FIT=1,
never PYAUTO_TEST_MODE (sweep env put the factor-graph search into reduced-
iterations mode -> 600s+ hang; structural pass always runs). Evidence under
the exact sweep env, fresh regen: start_here 24s, modeling 26s, lenstool
data 2s, lenstool modeling 175s (0.068" parity intact).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PUuWXiS23FvmfQPLvMNjeM
…#250)

data.py now writes the published model as ONE canonical mass.csv — 149
dPIEMassLenstool rows whose columns are the .par keywords verbatim (incl.
the run's H0/Om0) — plus members.csv in the galaxy_table schema with
ellipticity/angle_pos/mag properties. modeling.py loads everything through
al.galaxy_models_from_csv / al.galaxies_from_csv_tables /
al.galaxy_af_models_from_csv_tables — the bespoke rows_from_csv reader is
gone, and the named-halo refit models originate from the CSV with input.par
priors promoted on top. Reconstruction parity re-verified: 0.0680" median
source-plane rms, identical to pre-port. csv_api.py documents the Lenstool
rows, light-variant names, table properties and the new loud guards.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PUuWXiS23FvmfQPLvMNjeM
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 9, 2026
@Jammy2211
Jammy2211 merged commit a5155b3 into main Jul 9, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/csv-api-lenstool branch July 9, 2026 13:49
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 2026
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