Skip to content

feat: make Lenstool-native parameterization the default dPIE profile - #509

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/dpie-lenstool-default
Jul 17, 2026
Merged

feat: make Lenstool-native parameterization the default dPIE profile#509
Jammy2211 merged 1 commit into
mainfrom
feature/dpie-lenstool-default

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Makes the Lenstool-native parameterization the default dPIE mass profile, closing the library phase of #506. dPIEMass/dPIEMassSph now expose exactly the free parameters of a Lenstool .par file / published cluster results table (ellipticity, angle_pos, sigma = fiducial v_disp, r_core, r_cut, redshifts, flat H0/Om0 constants), so readers of Lenstool-based papers know exactly what the model is doing. The internal (ra, rs, b0) parameterization is demoted to the clearly-non-standard dPIEMassB0/dPIEMassB0Sph (also reachable via new from_b0 classmethods). All conventions were re-verified against Elíasdóttir et al. 2007 App. A, Bergamini et al. 2019 and the Lenstool C source before the swap — see the audit on #506; this PR is a pure re-parameterization with no numerical changes.

API Changes

Breaking rename-swap of the dPIE family (no numerical/physics changes):

  • dPIEMass / dPIEMassSph are now the Lenstool-native parameterized classes (formerly dPIEMassLenstool / dPIEMassLenstoolSph).
  • The internal (ra, rs, b0) classes are renamed dPIEMassB0 / dPIEMassB0Sph; from_lenstool (general-cosmology converter) now lives there and returns them.
  • New dPIEMass.from_b0(...) / dPIEMassSph.from_b0(...) classmethods construct the non-standard variant from the default entry point.
  • Priors config re-keyed to match; dPIEMassLenstool* names no longer exist.
    See full details below.

Test Plan

  • Full test_autogalaxy/ suite in the task worktree: 1003 passed.
  • af.Model prior resolution: dPIEMass 11 priors, dPIEMassSph 9, dPIEMassB0 7 (unchanged counts vs the pre-swap classes).
  • Renamed-class tests cover: from_lenstool b0/ellipticity conversions, default-class ≡ from_lenstool equivalence, from_b0 passthrough, potential/deflection consistency.
  • Workspace phase (follow-up PR): migrate cluster/group scripts + SLaM pipelines, re-run the 6-leg lenstool_parity.py.
Full API Changes (for automation & release notes)

Renamed

  • ag.mp.dPIEMassag.mp.dPIEMassB0 — internal (centre, ell_comps, ra, rs, b0) parameterization, now documented as non-standard.
  • ag.mp.dPIEMassSphag.mp.dPIEMassB0Sph — spherical internal variant.
  • ag.mp.dPIEMassLenstoolag.mp.dPIEMass — Lenstool-native parameterization is now the default.
  • ag.mp.dPIEMassLenstoolSphag.mp.dPIEMassSph — spherical default.

Changed Signature (same name, new parameters)

  • dPIEMass(centre, ellipticity, angle_pos, sigma, r_core, r_cut, redshift_object, redshift_source, H0, Om0) — was (centre, ell_comps, ra, rs, b0).
  • dPIEMassSph(centre, sigma, r_core, r_cut, redshift_object, redshift_source, H0, Om0) — was (centre, ra, rs, b0).

Added

  • dPIEMass.from_b0(centre, ell_comps, ra, rs, b0) → returns dPIEMassB0.
  • dPIEMassSph.from_b0(centre, ra, rs, b0) → returns dPIEMassB0Sph.

Changed Behaviour

  • from_lenstool classmethods now live on dPIEMassB0/dPIEMassB0Sph and return those classes; they remain the converter for arbitrary cosmology objects (e.g. Planck15), whereas the default constructors take flat H0/Om0 for model composition.
  • Priors config autogalaxy/config/priors/mass/total/dual_pseudo_isothermal_mass.yaml re-keyed: dPIEMassdPIEMassB0, dPIEMassSphdPIEMassB0Sph, dPIEMassLenstooldPIEMass, dPIEMassLenstoolSphdPIEMassSph (prior content unchanged).

Migration

  • Before: al.mp.dPIEMass(centre=..., ell_comps=..., ra=..., rs=..., b0=...) — After: al.mp.dPIEMassB0(...) (or al.mp.dPIEMass.from_b0(...)).
  • Before: al.mp.dPIEMassLenstool(...) — After: al.mp.dPIEMass(...) (same arguments).
  • Before: al.mp.dPIEMassSph.from_lenstool(...) — After: al.mp.dPIEMassB0Sph.from_lenstool(...).
  • Saved results / model.json referencing the old dPIEMass signature will not load into the new class (profile family shipped 2026-07, unreleased — accepted break).

Closes the library phase of #506.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K5MpYSYekRWVtoUmExAgKB

dPIEMass/dPIEMassSph now take Lenstool's native parameters (ellipticity,
angle_pos, sigma = fiducial v_disp, r_core, r_cut, redshifts, flat H0/Om0)
- the parameterization of published cluster/group-scale analyses - so a
fitted posterior reads like a Lenstool results table. The internal
(ra, rs, b0) classes are renamed dPIEMassB0/dPIEMassB0Sph (documented as
the non-standard variant), also reachable via the from_b0 classmethods.
from_lenstool stays on the B0 classes as the general-cosmology converter.
Priors config re-keyed, exports/docstrings/tests updated (#506).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5MpYSYekRWVtoUmExAgKB
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