Skip to content

feat: redesign subplot_fit panels — add Source Plane (Mid Zoom) - #518

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/subplot-fit-mid-zoom
May 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/subplot-fit-mid-zoom

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Reshuffles the 12-panel subplot_fit (and subplot_fit_log10) layout: drops the near-useless "Data (Source Scale)" panel, moves "Model Image" beside "Data", promotes the zoomed source plane to the top right and renames it "Source Plane (Max Zoom)", and adds a new "Source Plane (Mid Zoom)" panel — same centre as Max Zoom but with extents 2× larger, kept square and shrunk so it always sits inside the No Zoom extent (no edge exceeds, and at most 70% of the No Zoom half-width).

Blocked by: the corresponding PyAutoArray PR (adds zoom_extent_scale to plot_mapper / Mapper.extent_from). That must merge first or this PR's tests will fail against released PyAutoArray.

API Changes

  • _plot_source_plane(...) and plane_image_from(...) gain a zoom_extent_scale kwarg. plane_image_from also gains a zoom_extent_bounds kwarg.
  • subplot_fit and subplot_fit_log10 produce the new 12-panel layout — same panel count, different ordering, one renamed panel ("Source Plane (Zoomed)" → "Source Plane (Max Zoom)"), one new panel ("Source Plane (Mid Zoom)"), one removed panel ("Data (Source Scale)").

See full details below.

Test Plan

  • python -m pytest test_autolens/imaging/plot test_autolens/lens/plot -x passes
  • autolens_workspace_test/scripts/imaging/visualization.py runs cleanly for parametric, rectangular, and delaunay source types
  • Visual inspection of all three rendered fit.png files confirms Mid Zoom panel sits between Max Zoom and No Zoom
Full API Changes (for automation & release notes)

Added

  • _plot_source_plane(..., zoom_extent_scale=1.0) — new optional kwarg, forwarded to plane_image_from (parametric) and plot_mapper (inversion).
  • plane_image_from(..., zoom_extent_scale=1.0, zoom_extent_bounds=None) — new optional kwargs. When zoom_extent_scale > 1.0, scales the brightest-region extent by that factor about its centre; when zoom_extent_bounds is provided, the result is clamped so all edges stay inside that bound (kept square via a uniform shrink).

Changed Behaviour

  • subplot_fit panel layout changed (panel count unchanged):
    • idx 1 (row 0 col 1): was "Data (Source Scale)" → now "Model Image"
    • idx 3 (row 0 col 3): was "Model Image" → now "Source Plane (Max Zoom)" (renamed from "Source Plane (Zoomed)")
    • idx 7 (row 1 col 3): was "Source Plane (Zoomed)" → now new "Source Plane (Mid Zoom)" panel
    • The "Data (Source Scale)" panel is removed.
  • subplot_fit_log10 mirrors the same reshuffle.

Migration

None — both functions retain their existing signatures and produce a 3×4 grid of panels. Scripts that referenced panels by index will see a different image at the same index; scripts that referenced panels by title will need to use the new titles ("Source Plane (Max Zoom)" and "Source Plane (Mid Zoom)").

🤖 Generated with Claude Code

Reshuffle the 12-panel subplot_fit / subplot_fit_log10 layout:
- drop the near-useless Data (Source Scale) panel
- move Model Image beside Data
- promote the zoomed source plane to the top right as Source Plane
  (Max Zoom)
- add a new Source Plane (Mid Zoom) panel — same centre as Max Zoom,
  extents 2x larger, kept square, shrunk uniformly so all edges stay
  inside the No Zoom extent.

Plumbs a zoom_extent_scale kwarg through _plot_source_plane,
plane_image_from, and (via PyAutoArray) plot_mapper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 18, 2026
@Jammy2211
Jammy2211 merged commit aaaac48 into main May 18, 2026
6 checks passed
@Jammy2211
Jammy2211 deleted the feature/subplot-fit-mid-zoom branch August 25, 2026 18:18
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 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.

1 participant