Simplify subplot_fit_quick: use fit properties directly#551
Merged
Conversation
Replace closure-based API (fn(grid) with baked-in Galaxy constants) with parameterized API (fn(grid, params) with dynamic array inputs). This allows the lens mass model, source light, and lens light parameters to be varied between realizations without recompilation under jax.jit. Also adds optional lens_light_fn/lens_light_params for lens-plane light evaluation, and renames macro_* -> lens_* for consistency. Ref: PyAutoLens#542 — feedback from Max (mwiet) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
With @cached_property on Fit classes (PyAutoArray#341), model_data and related properties are computed once. The _slim_to_array2d pre-conversion and manual residual computation are no longer needed — just pass fit.data, fit.model_data, fit.normalized_residual_map etc. directly to plot_array. Net result: simpler code, correct arcsecond axes, source plane panel renders via _plot_source_plane, consistent styling with subplot_fit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Simplifies imaging
subplot_fit_quickby passing fit properties directly toplot_arrayinstead of pre-converting to numpy. With@cached_propertyon Fit classes (PyAutoArray#341),model_dataand related properties are computed once — the_slim_to_array2dpre-conversion and manual residual computation are no longer needed.Removes
_slim_to_array2d,_symmetric_vmax_from_slimhelpers. Net -62/+21 lines.API Changes
None — same function, same output.
Test Plan
pytest test_autolens/🤖 Generated with Claude Code