Skip to content

refactor: effective_einstein_radius latent drops its hardcoded seed fan - #735

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/einstein-radius-jit-seed-finder
Sep 11, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/einstein-radius-jit-seed-finder

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Follow-on to PyAutoLabs/PyAutoGalaxy#615 (issue PyAutoLabs/PyAutoGalaxy#614). LensCalc.einstein_radius_jit_from now finds its own Newton seed inside the JIT trace, so the JAX path of the effective_einstein_radius latent calls it with no init_guess. The fixed 4-seed fan at ±1 arcsec from the origin ([[1,0],[0,1],[-1,0],[0,-1]]) is deleted, along with the jax.numpy import it needed; the docstring now describes the in-trace seed search. The two test stubs of einstein_radius_jit_from mirror the new optional-argument signature.

Merge order: after PyAutoGalaxy#615. Against a PyAutoGalaxy without #615 the seedless call raises TypeError, which the latent's except (ValueError, AttributeError) does not catch. The PyAutoLens unit tests never reach the real jit path (they stub LensCalc), so they are green either way; the constraint is the release, and the pending-release label carries it.

API Changes

None — internal changes only. effective_einstein_radius(fit, magzero, xp=np) keeps its signature and its numpy path; only how the JAX path seeds the contour trace changes.

Test Plan

  • test_autolens/analysis/test_latent.py: 37 passed.
  • After both PRs merge: the Euclid pipeline's tests/test_compute_latent_variable.py::test_effective_einstein_radius re-checks the latent value against the Phase B baseline (~2.10 arcsec on the test dataset under PYAUTO_TEST_MODE=1).
Full API Changes (for automation & release notes)

Changed Behaviour

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_014JqpPWfk6nUAqnyv4P5oNM


Generated by Claude Code

`LensCalc.einstein_radius_jit_from` (PyAutoGalaxy#614) now finds its own
Newton seed inside the JIT trace, so the JAX path of the
`effective_einstein_radius` latent calls it with no `init_guess`. The
fixed 4-seed fan at ±1 arcsec from the origin could not converge for
off-centre lenses or Einstein radii outside its basin. The test stubs
mirror the new optional-argument signature.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JqpPWfk6nUAqnyv4P5oNM
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 11, 2026 — with Claude
@Jammy2211
Jammy2211 merged commit ae64a65 into main Sep 11, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/einstein-radius-jit-seed-finder branch September 11, 2026 01:50
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants