Skip to content

CTI resurrection Phase 1: Plotter to matplotlib function API#85

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cti-resurrection-phase1
Jul 17, 2026
Merged

CTI resurrection Phase 1: Plotter to matplotlib function API#85
Jammy2211 merged 1 commit into
mainfrom
feature/cti-resurrection-phase1

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of the CTI resurrection epic (#84; Phase 0 was #82/#83). The quarantined Plotter/PlotterInterface object stack — which targeted the autoarray MatPlot/Visuals/Include API removed from the stack — is deleted and PyAutoCTI visualization is rewritten on the matplotlib function API used by PyAutoGalaxy/PyAutoLens. The Phase-0 quarantine (detached autocti.plot, no-op visualizers, skipped plot tests) is fully removed: visualization now runs end-to-end during fits again.

API Changes

  • Removed: aplt.Dataset1DPlotter, aplt.FitDataset1DPlotter, aplt.ImagingCIPlotter, aplt.FitImagingCIPlotter, the PlotterInterface* classes, autocti/plot/get_visuals/, and all re-exported autoarray MatPlot*/Visuals*/Include*/wrap objects (already gone upstream).
  • Added: module-level functions in autocti.plotsubplot_dataset_1d, subplot_fit_dataset_1d, subplot_imaging_ci, subplot_imaging_ci_region, subplot_imaging_ci_data_binned, subplot_fit_ci, subplot_fit_ci_region, subplot_noise_scaling_map_dict, figure_* singles, combined *_list subplots, fits_fit_* writers, and the plot_cti_1d primitive. CTI region overlays/annotations (FPR value text, zero-line on EPERs, electronics settings) live in autocti/util/plot_utils.py.
  • During-fit visualization: VisualizerDataset1D/VisualizerImagingCI now drive config-gated PlotterDataset1D/PlotterImagingCI orchestrators (model/plotter.py), mirroring autogalaxy/analysis/plotter.py.
  • Config: config/visualize.yaml plots: schema simplified to ag-style keys; per-quantity booleans (noise_map, signal_to_noise_map, …) folded into the subplots.

See full details below.

Test Plan

  • python -m pytest test_autocti — 266 passed, 5 skipped (30 new plot/plotter tests; quarantine removed)
  • End-to-end smoke: both Plotters driven over dataset/regions/combined/fit paths produce the full figure surface (~40 files incl. fit.fits) into a scratch dir
  • import autocti.plot clean; from . import plot restored
Full API Changes (for automation & release notes)

Removed

  • autocti.plot.{Dataset1DPlotter, FitDataset1DPlotter, ImagingCIPlotter, FitImagingCIPlotter} — replaced by the function API below.
  • autocti.plot.{MatPlot1D, MatPlot2D, Visuals1D, Visuals2D, Include1D, Include2D, Output, ...} autoarray wrap re-exports — removed upstream.
  • autocti/model/plotter_interface.py, */model/plotter_interface.py, autocti/plot/abstract_plotters.py, autocti/plot/get_visuals/.

Added

  • autocti.plot functions: figure_dataset_1d_data, subplot_dataset_1d(_list), figure_fit_dataset_1d, subplot_fit_dataset_1d(_list), fits_fit_dataset_1d, figure_imaging_ci_data_region, figure_pre_cti_data_residual_map, subplot_imaging_ci(_region/_data_binned/_list/_data_region_list), figure_fit_ci_region, subplot_fit_ci(_region/_list/_region_list), subplot_noise_scaling_map_dict, fits_fit_ci, plot_cti_1d, plus plot_array/plot_yx autoarray re-exports and the autofit search plots.
  • autocti/model/plotter.py (Plotter, plot_setting), PlotterDataset1D, PlotterImagingCI.
  • autocti/util/plot_utils.py.

Migration

  • Before: aplt.ImagingCIPlotter(dataset=dataset, mat_plot_2d=...).subplot_dataset()
  • After: aplt.subplot_imaging_ci(dataset=dataset, output_path=..., output_format="png")
  • Before: plots.yaml per-quantity keys (noise_map: true, …)
  • After: subplot-level keys (subplot_dataset, subplot_fit, data, data_logy, residual_map, residual_map_logy, data_binned, fits_fit).

Notes

  • The old per-figure inventory is preserved as subplot panels; single figures remain for the scientifically load-bearing data/residual region plots (linear + log-y).
  • figures_1d_data_binned (rows/columns × FPR/no-FPR) is now one four-panel subplot_data_binned behind the data_binned key.
  • Workspace scripts/notebooks still reference the old API — updated in epic Phase 4.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Deletes the Plotter/PlotterInterface object stack, which targeted the
autoarray MatPlot/Visuals/Include API removed from the stack, and rewrites
PyAutoCTI visualization on the matplotlib function API used by PyAutoGalaxy:

- autocti/util/plot_utils.py: the plot_cti_1d primitive (errorbar/log-y/
  zero-line/text annotations) + region title/text/FPR-mask helpers ported
  from the old abstract Plotter.
- Per-domain function modules: dataset_1d/plot/{dataset_1d_plots,fit_plots}.py
  and charge_injection/plot/{imaging_ci_plots,fit_ci_plots}.py — subplot_*,
  figure_*, combined *_list subplots and fits_fit writers.
- Config-gated orchestrators autocti/model/plotter.py (base) +
  {dataset_1d,charge_injection}/model/plotter.py (PlotterDataset1D,
  PlotterImagingCI), driven by the af.Visualizer classes (Phase-0 ImportError
  quarantine removed).
- autocti/plot/__init__.py rebuilt as the function namespace; `from . import
  plot` restored in autocti/__init__.py.
- config/visualize.yaml plots schema simplified to the PyAutoGalaxy-style
  subplot/figure keys (subplot_dataset, subplot_dataset_regions, data,
  data_logy, data_binned, subplot_fit, subplot_fit_regions, residual_map,
  residual_map_logy, fits_fit, fpr_non_uniformity, combined_only).
- Plot tests rewritten for the function API (plot_patch modernized to
  intercept Figure.savefig); conftest collect_ignore quarantine removed.

test_autocti: 266 passed, 5 skipped (Phase-2 aggregator ports).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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