feat: CSV API extensions from the stress-test (light variants, loud guards, table properties, flat cosmology)#491
Merged
Conversation
…, table properties, flat cosmology)
Stress-tested the named-galaxy model CSVs + galaxy_table against realistic user
requirements (PyAutoGalaxy#490); dPIEMassLenstool/.par rows, NFW redshift args,
shear+PowerLaw sparse files, multipoles and PointFlux all passed as-is. Gaps
fixed:
- light.csv: linear/operated/linear_operated variants via qualified class
names ('linear.Sersic'); plain names stay standard (shared class names made
a namespace chain ambiguous).
- Loud guards: duplicate (galaxy, attr_name) rows and typo'd parameter columns
now raise (both previously silent — a typo silently left the profile at its
default).
- GalaxyTable.properties: extra catalogue columns (numeric -> float lists,
strings -> string lists) load instead of being silently dropped; writer
gains properties=. Member catalogues can carry shape + mag.
- dPIEMassLenstool(Sph): H0/Om0 float args (Planck15-value defaults) so a
Lenstool run's cosmology is CSV-able/prior-configurable; prior configs added.
12 new/updated unit tests; full suite green.
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
CSV API extensions driven by an empirical stress-test against realistic user requirements (issue #490; user directive to make the canonical CSV API the single interface the Lenstool example teaches). The stress harness pushed
.par-styledPIEMassLenstoolrows, NFW redshift args, shear + PowerLaw sparse files, multipoles,PointFlux, flux/time-delay data columns and member catalogues throughmass/light/point.csv+galaxy_table— most passed as-is; this PR fixes what didn't.API Changes
Added: qualified light-variant class names in
light.csv(linear.Sersic,operated.Gaussian,linear_operated.*— plain names stay standard);GalaxyTable.properties(extra catalogue columns load as float/string lists — nothing silently dropped) +galaxy_table_to_csv(properties=);dPIEMassLenstool(Sph)gainH0/Om0float args (Planck15-value defaults, so a Lenstool run's cosmology is CSV-able) with prior-config entries. Behaviour changed (loud guards): duplicate(galaxy, attr_name)rows and typo'd parameter columns in model CSVs now raiseValueError(both previously silent — a typo left the profile at its default value).dPIEMassLenstoolwrapper prior_count grows 9→11 (fix H0/Om0 for the old count).See full details below.
Test Plan
Validation checklist (--auto run — in-session directive)
Full API Changes
Added
light.csvqualifiedprofile_classcells for non-standard light namespaces:linear.<Name>,operated.<Name>,linear_operated.<Name>; writer derives the qualifier automatically.GalaxyTable.properties: Dict[str, List]— every extra CSV column, numeric → floats, else strings;galaxy_table_to_csv(..., properties={name: values}).dPIEMassLenstool.__init__(..., H0=67.66, Om0=0.30966)anddPIEMassLenstoolSphlikewise (FlatLambdaCDM built from the flats; defaults reproduce prior behaviour to the massive-neutrino level); priors config entries for both.Changed Behaviour
galaxy_models_from_csvraises on columns no row's class consumes (typo guard).galaxies_from_csv_tables/galaxy_af_models_from_csv_tablesraise on duplicate(galaxy, attr_name)pairs (previously silent overwrite).galaxy_table_from_csvno longer silently ignores extra columns (they load intoproperties).Migration
🤖 Generated with Claude Code