Skip to content

feat: CSV API extensions from the stress-test (light variants, loud guards, table properties, flat cosmology)#491

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/csv-api-lenstool
Jul 9, 2026
Merged

feat: CSV API extensions from the stress-test (light variants, loud guards, table properties, flat cosmology)#491
Jammy2211 merged 1 commit into
mainfrom
feature/csv-api-lenstool

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

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-style dPIEMassLenstool rows, NFW redshift args, shear + PowerLaw sparse files, multipoles, PointFlux, flux/time-delay data columns and member catalogues through mass/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) gain H0/Om0 float 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 raise ValueError (both previously silent — a typo left the profile at its default value). dPIEMassLenstool wrapper prior_count grows 9→11 (fix H0/Om0 for the old count).
See full details below.

Test Plan

  • 12 new/updated unit tests (variant round-trips incl. qualified-name cells, both guards, table properties incl. legacy 3-column and string columns, Lenstool-row round-trip, H0/Om0 behaviour + count updates)
  • Full PyAutoGalaxy suite (count in issue)
  • Downstream: the Lenstool example rebuilt end-to-end on these APIs at identical 0.0680″ parity (companion PR)

Validation checklist (--auto run — in-session directive)

Full API Changes

Added

  • light.csv qualified profile_class cells 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) and dPIEMassLenstoolSph likewise (FlatLambdaCDM built from the flats; defaults reproduce prior behaviour to the massive-neutrino level); priors config entries for both.

Changed Behaviour

  • galaxy_models_from_csv raises on columns no row's class consumes (typo guard).
  • galaxies_from_csv_tables / galaxy_af_models_from_csv_tables raise on duplicate (galaxy, attr_name) pairs (previously silent overwrite).
  • galaxy_table_from_csv no longer silently ignores extra columns (they load into properties).

Migration

  • None expected for valid files; CSVs that relied on silently-ignored typo'd columns now fail loudly (that is the point).

🤖 Generated with Claude Code

…, 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
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 9, 2026
@Jammy2211 Jammy2211 merged commit 3a8be95 into main Jul 9, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/csv-api-lenstool branch July 9, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant