Skip to content

docs: fill plot.py coverage gaps against the source plot modules - #191

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/plot-coverage-gaps
Jul 30, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/plot-coverage-gaps

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Autogalaxy half of PyAutoLabs/PyAutoLens#667.

The plot-guides-restructure task created the per-dataset plot.py family but never audited whether each file demonstrates the functions its dataset/fit type actually has. An audit of every public function in the source *_plots.py modules against every aplt.* call in the workspace found several used nowhere in the repo — most notably subplot_fit_real_space, and the fit-level subplot_fit_dirty_images which was absent from plot.py despite the dataset-level subplot_interferometer_dirty_images being demonstrated.

plot.py coverage rises from 11 → 14 of the 28 symbols autogalaxy.plot exports.

Upstream PR

PyAutoLabs/PyAutoLens#668 — the library leg of the parent issue. No autogalaxy-side dependency: everything this PR calls is already exported by autogalaxy.plot. Listed for merge-ordering context only; this PR is safe to merge independently of it.

Scripts Changed

Script Added
scripts/imaging/plot.py subplot_fit_imaging_of_galaxy (per-galaxy subplots, galaxy_index 0 and 1), a use_log10=True variant of subplot_fit_imaging, fits_imaging
scripts/interferometer/plot.py fit-level subplot_fit_dirty_images, subplot_fit_real_space, fits_interferometer

Each file's __Contents__ index was updated to match, and each file's __Visualizer__ section remains last. Notebooks regenerated from scripts (never edited directly).

Note the two distinct dirty-image functions, which is what made this gap easy to miss: dataset-level subplot_interferometer_dirty_images (already demonstrated) versus fit-level subplot_fit_dirty_images (was not).

Test Plan

  • Both scripts executed sequentially in test mode with visualization on (MPLBACKEND=Agg, PYAUTO_TEST_MODE=1). 2/2 ran to completion through their final Visualizer print. Sequential because parallel workspace runs fake failures through shared state.
  • Coverage matrix re-run against the edited files rather than trusting the edits: 22/22 planned gaps closed across both workspaces.
  • Leak check: git status --porcelain showed only the intended files. The fits_* sections write to output/plot/…, confirmed gitignored via git check-ignore.
  • Notebook regeneration produced changes to exactly these 2 notebooks plus the two catalogue files — no unrelated drift swept in.
Deliberately excluded, with reasons
  • subplot_ellipse_errors — takes fit_pdf_list: List[List[FitEllipse]], one inner list per posterior sample. A standalone plot.py runs no search, so demonstrating it needs a real model-fit. Filed as a follow-up rather than faked with synthetic samples.
  • Galaxy / profile subplots (subplot_galaxies, subplot_galaxy_light_profiles, subplot_galaxy_mass_profiles, subplot_galaxy_images, subplot_basis_image, subplot_adapt_images) — already covered in guides/. Not duplicated; plot.py owns dataset+fit plotting for its own data type.
  • Results / search plots (subplot_parameters, log_likelihood_vs_iteration, output_figure, corner_anesthetic) — guides/plot/searches.py and guides/results/ material.

Generated by the PyAutoLabs agent workflow.

The per-dataset plot.py family created by the plot-guides-restructure task was
never audited for per-file function coverage.

Adds the missing fit-level demos, plus a FITS output section:

- imaging: subplot_fit_imaging_of_galaxy (per-galaxy subplots), a use_log10
  variant of subplot_fit_imaging, fits_imaging
- interferometer: fit-level subplot_fit_dirty_images, subplot_fit_real_space,
  fits_interferometer

Note the two distinct dirty-image functions: the dataset-level
subplot_interferometer_dirty_images was already demonstrated; the fit-level
subplot_fit_dirty_images was not.

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 6ca53f8 into main Jul 30, 2026
10 checks passed
@Jammy2211
Jammy2211 deleted the feature/plot-coverage-gaps branch July 30, 2026 15:22
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 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