docs: Lenstool example on the canonical CSV API end to end (stacked on #250)#252
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pywrites the published Mahler et al. model as one canonicalmass.csv: 149 rows ofprofile_class = dPIEMassLenstoolwhose columns are the.parkeywords verbatim (sigma, r_core, r_cut, ellipticity, angle_pos) plus the run's redshifts andH0/Om0— the.parfile as a table. The member catalogue becomesmembers.csvin thegalaxy_tableschema withellipticity/angle_pos/magproperty columns.modeling.pyloads everything throughal.galaxy_models_from_csv/al.galaxies_from_csv_tables(reconstruction: one call for all 149 components) andal.galaxy_af_models_from_csv_tables(refit: the named halos start as af.Models straight from the CSV, withinput.par's priors promoted on top) — the bespokerows_from_csvreader is deleted.csv_api.pydocuments 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
scripts/cluster/lenstool/{data,modeling}.py,scripts/cluster/csv_api.py(+ catalogue regen).Merge order
Validation checklist (--auto run)
🤖 Generated with Claude Code