feat: make Lenstool-native parameterization the default dPIE profile - #509
Merged
Conversation
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
This was referenced Jul 17, 2026
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
Makes the Lenstool-native parameterization the default dPIE mass profile, closing the library phase of #506.
dPIEMass/dPIEMassSphnow expose exactly the free parameters of a Lenstool.parfile / published cluster results table (ellipticity,angle_pos,sigma= fiducial v_disp,r_core,r_cut, redshifts, flatH0/Om0constants), 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-standarddPIEMassB0/dPIEMassB0Sph(also reachable via newfrom_b0classmethods). 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/dPIEMassSphare now the Lenstool-native parameterized classes (formerlydPIEMassLenstool/dPIEMassLenstoolSph).(ra, rs, b0)classes are renameddPIEMassB0/dPIEMassB0Sph;from_lenstool(general-cosmology converter) now lives there and returns them.dPIEMass.from_b0(...)/dPIEMassSph.from_b0(...)classmethods construct the non-standard variant from the default entry point.dPIEMassLenstool*names no longer exist.See full details below.
Test Plan
test_autogalaxy/suite in the task worktree: 1003 passed.af.Modelprior resolution:dPIEMass11 priors,dPIEMassSph9,dPIEMassB07 (unchanged counts vs the pre-swap classes).lenstool_parity.py.Full API Changes (for automation & release notes)
Renamed
ag.mp.dPIEMass→ag.mp.dPIEMassB0— internal(centre, ell_comps, ra, rs, b0)parameterization, now documented as non-standard.ag.mp.dPIEMassSph→ag.mp.dPIEMassB0Sph— spherical internal variant.ag.mp.dPIEMassLenstool→ag.mp.dPIEMass— Lenstool-native parameterization is now the default.ag.mp.dPIEMassLenstoolSph→ag.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)→ returnsdPIEMassB0.dPIEMassSph.from_b0(centre, ra, rs, b0)→ returnsdPIEMassB0Sph.Changed Behaviour
from_lenstoolclassmethods now live ondPIEMassB0/dPIEMassB0Sphand return those classes; they remain the converter for arbitrarycosmologyobjects (e.g.Planck15), whereas the default constructors take flatH0/Om0for model composition.autogalaxy/config/priors/mass/total/dual_pseudo_isothermal_mass.yamlre-keyed:dPIEMass→dPIEMassB0,dPIEMassSph→dPIEMassB0Sph,dPIEMassLenstool→dPIEMass,dPIEMassLenstoolSph→dPIEMassSph(prior content unchanged).Migration
al.mp.dPIEMass(centre=..., ell_comps=..., ra=..., rs=..., b0=...)— After:al.mp.dPIEMassB0(...)(oral.mp.dPIEMass.from_b0(...)).al.mp.dPIEMassLenstool(...)— After:al.mp.dPIEMass(...)(same arguments).al.mp.dPIEMassSph.from_lenstool(...)— After:al.mp.dPIEMassB0Sph.from_lenstool(...).model.jsonreferencing the olddPIEMasssignature 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