Repository navigation
docs: fill plot.py coverage gaps against the source plot modules - #404
Merged
Merged
Conversation
The per-dataset plot.py family created by the plot-guides-restructure task was never audited for per-file function coverage. imaging/plot.py called subplot_fit_imaging and nothing else, and its own __Visualizer__ section named subplot_of_planes in prose while never demonstrating it. Adds the missing dataset- and fit-level demos, plus a FITS output section: - imaging: subplot_fit_imaging_of_planes, subplot_fit_imaging_log10, subplot_fit_imaging_tracer, fits_imaging - interferometer: subplot_interferometer_dataset (newly exported upstream), subplot_fit_dirty_images, subplot_fit_interferometer_real_space, subplot_fit_interferometer_tracer, fits_interferometer - weak: plot_convergence_map, plot_data_vs_model, plot_residuals, plot_chi_squared_map - cluster: plot_image_group_zooms, plot_critical_curves, plot_caustics - point_source: subplot_point_dataset subplot_fit_imaging_x1_plane and its log10 variant are deliberately NOT called: subplot_fit dispatches to them itself for single-plane tracers, so on the two-plane example fits they are unreachable. A prose line documents the auto-switch instead. Co-Authored-By: Claude Opus 5 <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
Workspace half of PyAutoLabs/PyAutoLens#667.
The
plot-guides-restructuretask created the per-datasetplot.pyfamily but never audited whether each file demonstrates the functions its dataset/fit type actually has.scripts/imaging/plot.pycalledaplt.subplot_fit_imagingand nothing else — and its own__Visualizer__section namedsubplot_of_planesin prose while never demonstrating it, hand-rolling afit.model_images_of_planes_listloop in its place.An audit of every public function in the source
*_plots.pymodules against everyaplt.*call in the workspace foundsubplot_fit_imaging_log10,subplot_fit_imaging_of_planesandsubplot_fit_imaging_tracerused nowhere in the repo at all. This adds those and the equivalent gaps in four otherplot.pyfiles.plot.pycoverage rises from 18 → 36 of the 63 symbolsautolens.plotexports.Upstream PR
PyAutoLabs/PyAutoLens#668 — must merge first. It exports
subplot_interferometer_dataset, whichscripts/interferometer/plot.pynow calls. Without it that call raisesAttributeError.Scripts Changed
scripts/imaging/plot.pysubplot_fit_imaging_of_planes(incl.plane_indexform),subplot_fit_imaging_log10,subplot_fit_imaging_tracer,fits_imagingscripts/interferometer/plot.pysubplot_interferometer_dataset, fit-levelsubplot_fit_dirty_images,subplot_fit_interferometer_real_space,subplot_fit_interferometer_tracer,fits_interferometerscripts/weak/plot.pyplot_convergence_map,plot_data_vs_model,plot_residuals,plot_chi_squared_mapscripts/cluster/plot.pyplot_image_group_zooms,plot_critical_curves,plot_causticsscripts/point_source/plot.pysubplot_point_datasetEach file's
__Contents__index was updated to match. Every file's__Visualizer__section remains last. Notebooks regenerated from scripts (never edited directly).Two notes on the changes:
interferometer/plot.pypreviously used "Dataset Subplot" as the heading for the dirty images. Now that a real dataset subplot exists, that section is renamed__Dirty Images Subplot__and__Dataset Subplot__covers the uv-plane quantities.cluster/plot.pyneeds aTracerfor critical curves and caustics. Rather than duplicatingstart_here.py's model composition, it builds the truth model straight from the dataset's ownmass.csv/point.csvviaal.galaxy_af_models_from_csv_tables(). Those models haveprior_count == 0(every CSV value is a fixed default), soinstance_from_prior_medians()returns the exact truth galaxies rather than a sample — 6 lines, no fitting.Test Plan
MPLBACKEND=Agg,PYAUTO_TEST_MODE=1), against the branch build of PyAutoLens via a shared task worktree. 5/5 ran to completion through their finalVisualizerprint. Sequential because parallel workspace runs fake failures through shared state.*_x1_planepair verified as called nowhere.git status --porcelainshowed only the intended files. Thefits_*sections write tooutput/plot/…, confirmed gitignored viagit check-ignore; the written FITS was opened and confirmed to hold the expected named HDUs (MASK,DATA,PSF,NOISE_MAP).Deliberately excluded, with reasons
subplot_fit_imaging_x1_plane/subplot_fit_imaging_log10_x1_plane— not added as calls.subplot_fitdispatches to them itself (fit_imaging_plots.py:214,:346,:512) whenlen(fit.tracer.planes) == 1. On the two-plane example fits here they are unreachable by design, so a call would teach a wrong idiom. A prose line in__Fit Subplot__documents the auto-switch instead.subplot_tracer,subplot_galaxies,subplot_galaxy_light_profiles,subplot_galaxy_mass_profiles,subplot_galaxy_images,subplot_basis_image,subplot_adapt_images) — already covered inguides/(guides/tracer.py,guides/galaxies.py,guides/plot/start_here.py). Not duplicated;plot.pyowns dataset+fit plotting for its own data type.subplot_parameters,log_likelihood_vs_iteration,output_figure,corner_anesthetic) —guides/plot/searches.pyandguides/results/material.subplot_fit_interferometer_combined— newly exported in #668 for API symmetry with imaging'ssubplot_fit_combined, but not demonstrated here. It takes afit_list, so its natural home is a multi-dataset interferometer example, not this single-fit script; passing[fit, fit]would teach a wrong idiom. Follow-up.subplot_sensitivity_tracer_images,subplot_sensitivity_figures_of_merit) — belong to the subhalo/sensitivity feature area.Generated by the PyAutoLabs agent workflow.