Repository navigation
feat: cluster plots honor the configured critical-curve engine - #808
Merged
Merged
Conversation
plot_critical_curves and plot_caustics in autolens/cluster/plot/cluster_plots.py always called the marching-squares LensCalc routines. They now read general.critical_curves_method once per call through PyAutoGalaxy's autogalaxy.util.plot_utils._critical_curves_method() (same unknown-value and missing-jax_zero_contour fallbacks as every other plot) and route each source plane's tangential/radial critical curves and caustics to the marching-squares (*_list_from(grid=grid), default, unchanged) or zero-contour (*_list_via_zero_contour_from()) routines. Multi-plane LensCalc per plane, colours, labels, radial option and source-plane mapping preserved. Known limit, documented: zero_contour seeds from LensCalc's +/-3" coarse scan, so cluster-scale curves outside that box are not drawn (remaining phase-3 scope). No public API change. Issue #807. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8NtZ6QtuqxKKAnhhdg
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
Closes #807 (
cluster-strong-lensingepic, phase-3a subtask).plot_critical_curvesandplot_causticsinautolens/cluster/plot/cluster_plots.pyalways called the marching-squaresLensCalcroutines and ignoredgeneral.critical_curves_method.They now read that setting once per call through PyAutoGalaxy's shared selector,
autogalaxy.util.plot_utils._critical_curves_method(). That selector already applies the unknown-value fallback and the missing-jax_zero_contourfallback, so cluster plots behave exactly like every other plot. Each source plane's tangential and radial critical curves and caustics are routed as follows:marching_squares(the default) calls*_list_from(grid=grid), exactly as before.zero_contourcalls*_list_via_zero_contour_from()with its defaults, asag.util.plot_utils._critical_curves_fromand_caustics_fromdo.The multi-plane
LensCalcper plane (use_multi_plane=True, plane_j=j), the colours, labels, radial option and source-plane mapping are all unchanged.Known limit, documented in the docstrings. With
zero_contour, seeds come fromLensCalc's automatic ±3" coarse scan, so cluster-scale curves outside that box are not drawn. This matches the other plots' behaviour. Cluster-scale accuracy and context-aware dispatch belong to the remaining phase-3 scope.API Changes
None. This is internal routing only: there are new private helpers
_CURVE_ROUTINES,_critical_curves_methodand_curve_list_from.See full details below.
Test Plan
test_autolens/cluster/plot/test_cluster_plots.py: 12 passed, 6 of them new. They use a two-source-planePowerLawfixture with tangential and radial curves in both planes.zero_contourwithjax_zero_contourunavailable falls back to marching squares and logs a warning.python -m pytest test_autolens -n 8: 979 passed, 1 skipped, 1 xfailed.Full API Changes (for automation & release notes)
Added
_CURVE_ROUTINES,_critical_curves_method(),_curve_list_from(lens_calc, grid, method, kind, curve_type)inautolens/cluster/plot/cluster_plots.py.Removed
Migration
general.critical_curves_method: zero_contouris configured.Generated by the PyAutoLabs agent workflow.
Generated by Claude Code