Skip to content

Simplify subplot_fit_quick: use fit properties directly#551

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/simplify-subplot-quick
May 27, 2026
Merged

Simplify subplot_fit_quick: use fit properties directly#551
Jammy2211 merged 2 commits into
mainfrom
feature/simplify-subplot-quick

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Simplifies imaging subplot_fit_quick by passing fit properties directly to plot_array instead of pre-converting to numpy. 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.

Removes _slim_to_array2d, _symmetric_vmax_from_slim helpers. Net -62/+21 lines.

API Changes

None — same function, same output.

Test Plan

  • Renders correct arcsecond axes, source plane panel, consistent styling
  • pytest test_autolens/

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits May 27, 2026 19:22
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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 27, 2026
@Jammy2211 Jammy2211 merged commit 0e45d43 into main May 27, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/simplify-subplot-quick branch May 27, 2026 18:28
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