Skip to content

test: Lenstool dPIE parity script (6 numerical legs)#151

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/dpie-lenstool-param
Jul 9, 2026
Merged

test: Lenstool dPIE parity script (6 numerical legs)#151
Jammy2211 merged 1 commit into
mainfrom
feature/dpie-lenstool-param

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds scripts/cluster/lenstool_parity.py — the numerical parity check backing the Lenstool-native dPIE parameterization shipped in PyAutoLabs/PyAutoGalaxy#487 (issue PyAutoLabs/PyAutoGalaxy#485). Six legs, all asserting at 1e-3 or tighter and currently passing at 1e-7–1e-10:

  1. from_lenstool conversion parity (b0 prefactor, sqrt(3/2) sigma relation via the independent cosmology.velocity_dispersion_from, emass→epot vs Lenstool's set_lens.c formula).
  2. Spherical deflection vs quadrature of the independently-ported convergence.
  3. Analytic enclosed-convergence closed form (ra→0).
  4. Elliptical deflections vs finite-difference gradient of the analytic pi05 potential.
  5. analytical_hessian_2d_from vs deflection finite differences (profile frame; frame convention documented in the script).
  6. The port's original Lenstool-generated reference deflections re-derived through the full conversion layer.

Includes a documented recipe (.par stanza) for regenerating true Lenstool reference values with a Lenstool build.

Scripts Changed

  • Added: scripts/cluster/lenstool_parity.py — pure numpy, no dataset dependencies, runs in ~20 s.

Merge gate

Library-first: merge PyAutoLabs/PyAutoGalaxy#487 before this PR (the script imports from_lenstool / the analytic potential).

Validation checklist (--auto run — in-session directives, no separate plan pre-approval)

  • Effective level: supervised (header: supervised, cap: feature → supervised)
  • Gate: script passes end-to-end against the library branch (6/6 legs) · Heart YELLOW acked in-session
  • Human: merge after the library PR

🤖 Generated with Claude Code

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 8, 2026
@Jammy2211 Jammy2211 merged commit 1e204af into main Jul 9, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/dpie-lenstool-param branch July 9, 2026 08:59
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