Skip to content

feat: export subplot_fit_interferometer_dirty_images (autolens's own) - #670

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/al-dirty-images-export
Jul 30, 2026
Merged

feat: export subplot_fit_interferometer_dirty_images (autolens's own)#670
Jammy2211 merged 1 commit into
mainfrom
feature/al-dirty-images-export

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Follow-up 4 from #667 — a live API defect.

aplt.subplot_fit_dirty_images resolves to the autogalaxy implementation inside autolens.plot:

>>> aplt.subplot_fit_dirty_images.__module__
'autogalaxy.interferometer.plot.fit_interferometer_plots'

autolens has its own version in autolens/interferometer/plot/fit_interferometer_plots.py, and it was reachable under no exported name at all.

That version is not merely a duplicate. When image_plane_lines is None it auto-derives the tracer's critical curves from the fit and overlays them on the dirty model image — lensing information the autogalaxy version cannot produce. Lens users calling aplt.subplot_fit_dirty_images were silently getting the galaxy version and losing that overlay.

API Changes

One symbol added: subplot_fit_interferometer_dirty_images, bound to autolens's own function. Purely additive — nothing removed, renamed, or resignatured.

subplot_fit_dirty_images is deliberately left bound to the autogalaxy version. The two signatures diverge (residuals_symmetric_cmap on the AG side, image_plane_lines / image_plane_line_colors on the AL side), so rebinding it would be a behaviour change, not an additive export.

This matches the convention already in the file: subplot_fit_real_space (autogalaxy) coexists with subplot_fit_interferometer_real_space (autolens's own). subplot_fit_dirty_images had simply never been given its subplot_fit_interferometer_* counterpart.

See full details below.

Test Plan

  • Full PyAutoLens suite: 488 passed, 0 failed (55.7s)
  • Additivity asserted programmatically against the branch build — new name resolves to autolens.…, old name still resolves to autogalaxy.…:
    • subplot_fit_interferometer_dirty_imagesautolens.interferometer.plot.fit_interferometer_plots
    • subplot_fit_dirty_imagesautogalaxy.interferometer.plot.fit_interferometer_plots (unchanged)
  • Functionally exercised on a real FitInterferometer, not just signature-checked: the new export renders and auto-derives 1 critical curve via _compute_critical_curve_lines; the old export still renders unchanged.
  • git diff --stat = 2 files, 2 insertions, 0 deletions
Full API Changes (for automation & release notes)

Added

  • autolens.plot.subplot_fit_interferometer_dirty_images(fit, output_path=, output_format=, colormap=, use_log10=False, image_plane_lines=, image_plane_line_colors=, title_prefix=) — 2×3 subplot of dirty-image diagnostics for an interferometer fit, overlaying the tracer's critical curves on the dirty model image. Auto-derives the curves from the fit when image_plane_lines is None. Re-export of autolens.interferometer.plot.fit_interferometer_plots.subplot_fit_dirty_images.

Removed / Renamed / Changed Signature / Changed Behaviour

None. subplot_fit_dirty_images continues to resolve to the autogalaxy implementation exactly as before.

Migration

None required. Lens users wanting the critical-curve overlay switch call sites:

  • Before: aplt.subplot_fit_dirty_images(fit=fit) — galaxy version, no overlay
  • After: aplt.subplot_fit_interferometer_dirty_images(fit=fit) — overlay auto-derived
Deferred: the 11 existing workspace call sites

autolens_workspace calls aplt.subplot_fit_dirty_images at 11 sites (scripts/interferometer/{fit,modeling,plot}.py, four interferometer/features/*/fit.py, and multi/features/imaging_and_interferometer/modeling.py). All pass fit=fit only — none pass residuals_symmetric_cmap — so all 11 could be switched to the new name and would gain critical-curve overlays for free.

Not done here: that is a visual change across 11 lens examples and deserves its own review, separate from making the function reachable. Filed against #667.

Generated by the PyAutoLabs agent workflow.

`aplt.subplot_fit_dirty_images` resolves to the AUTOGALAXY implementation
inside `autolens.plot`, so autolens's own version in
`autolens/interferometer/plot/fit_interferometer_plots.py` was reachable
under no exported name at all.

The autolens version auto-derives the tracer's critical curves from the fit
when `image_plane_lines is None` and overlays them on the dirty model image
— lensing information the autogalaxy version cannot produce.

Exported additively as `subplot_fit_interferometer_dirty_images`, matching
the existing `subplot_fit_real_space` / `subplot_fit_interferometer_real_space`
convention. `subplot_fit_dirty_images` is deliberately left bound to the
autogalaxy version: the two signatures differ (`residuals_symmetric_cmap` vs
`image_plane_lines`), so rebinding it would be a behaviour change rather than
an additive export.

Follow-up 4 from #667.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 30, 2026
@Jammy2211
Jammy2211 merged commit 339867e into main Jul 30, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/al-dirty-images-export branch July 30, 2026 15:34
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