Repository navigation
refactor: effective_einstein_radius latent drops its hardcoded seed fan - #735
Merged
Merged
Conversation
`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
This was referenced Sep 11, 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
Follow-on to PyAutoLabs/PyAutoGalaxy#615 (issue PyAutoLabs/PyAutoGalaxy#614).
LensCalc.einstein_radius_jit_fromnow finds its own Newton seed inside the JIT trace, so the JAX path of theeffective_einstein_radiuslatent calls it with noinit_guess. The fixed 4-seed fan at ±1 arcsec from the origin ([[1,0],[0,1],[-1,0],[0,-1]]) is deleted, along with thejax.numpyimport it needed; the docstring now describes the in-trace seed search. The two test stubs ofeinstein_radius_jit_frommirror the new optional-argument signature.Merge order: after PyAutoGalaxy#615. Against a PyAutoGalaxy without #615 the seedless call raises
TypeError, which the latent'sexcept (ValueError, AttributeError)does not catch. The PyAutoLens unit tests never reach the real jit path (they stubLensCalc), so they are green either way; the constraint is the release, and thepending-releaselabel 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.tests/test_compute_latent_variable.py::test_effective_einstein_radiusre-checks the latent value against the Phase B baseline (~2.10 arcsec on the test dataset underPYAUTO_TEST_MODE=1).Full API Changes (for automation & release notes)
Changed Behaviour
autolens.analysis.latent.effective_einstein_radius(JAX path) — callsLensCalc.einstein_radius_jit_from()with no seed; the seed is found in-trace by PyAutoGalaxy. Requires PyAutoGalaxy with fix: COOLEST interop rejects relative file paths #615.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_014JqpPWfk6nUAqnyv4P5oNM
Generated by Claude Code