Overview
Phase 1 of the CTI resurrection epic (Phase 0: #82 / PR #83, merged). PyAutoCTI's visualization layer still targets the autoarray Plotter/MatPlot/Visuals/Include object API that was removed from the stack, and is currently quarantined (autocti.plot detached, visualizers no-op with a logged warning, plot tests skipped). This phase rewrites it on the matplotlib function API used by PyAutoGalaxy/PyAutoLens and removes the quarantine.
Plan
- Delete the Plotter object stack:
autocti/plot/abstract_plotters.py, autocti/plot/get_visuals/, 5 Plotter classes, 3 PlotterInterface classes.
- Add per-domain function modules mirroring
autogalaxy/imaging/plot/fit_imaging_plots.py: dataset_1d/plot/{dataset_1d_plots,fit_plots}.py (1D line figures/subplots) and charge_injection/plot/{imaging_ci_plots,fit_ci_plots}.py (2D figures/subplots + 1D binned FPR/EPER region plots).
- CTI region overlays (parallel/serial overscan, serial prescan, FPR/EPER extracts — formerly autoarray
wrap objects) become CTI-local matplotlib helpers in autocti/util/plot_utils.py.
- Rebuild
autocti/plot/__init__.py as the function namespace (aplt.subplot_*); restore from . import plot in autocti/__init__.py.
- Rewire both
model/visualizer.py classes onto the new functions per config/visualize/plots.yaml (drop the Phase-0 try/except quarantine); align plots.yaml schema with current ag where keys overlap.
- Replace the quarantined plot tests with tests of the new functions + visualizers; remove
collect_ignore from test_autocti/conftest.py.
Out of scope: aggregator factor-graph port (Phase 2), CI/ecosystem plumbing (Phase 3), workspace update (Phase 4).
Detailed implementation plan
Affected Repositories
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoCTI |
main (post-#83 merge, clean) |
clean |
Suggested branch: feature/cti-resurrection-phase1
Implementation Steps
- Inventory the figure surface from the old classes before deleting (
Dataset1DPlotter.figures_1d/subplot_dataset, FitDataset1DPlotter, ImagingCIPlotter.figures_2d/figures_1d(region=…)/subplot_dataset, FitImagingCIPlotter, the three PlotterInterfaces' plots.yaml-driven orchestration).
- Write
autocti/util/plot_utils.py: 1D line/subplot helpers, 2D array helpers delegating to autoarray.structures.plot.structure_plots (plot_array_2d, plot_yx_1d) + autoarray.plot.utils (subplots, save/output helpers), and the CTI region-overlay helpers.
- Write the four per-domain
*_plots.py function modules (subplot + individual figures + fits output where the old stack had them).
- Rebuild
autocti/plot/__init__.py; restore the package import; delete the dead files.
- Rewire
dataset_1d/model/visualizer.py + charge_injection/model/visualizer.py to call the new functions, honoring config/visualize/plots.yaml; sync yaml keys.
- New tests per module (plot_patch/output assertions, matching current ag test style); remove conftest quarantine; full suite green.
Key Files
autocti/plot/ — namespace rebuild; object stack deleted
autocti/{dataset_1d,charge_injection}/plot/* — new function modules
autocti/{dataset_1d,charge_injection}/model/visualizer.py — rewire
autocti/util/plot_utils.py — new helpers (region overlays)
autocti/config/visualize/plots.yaml — schema sync
test_autocti/conftest.py — remove collect_ignore
Original Prompt
PyAutoMind prompt: draft/feature/autocti/cti_resurrection_phase1_viz_migration.md (epic origin verbatim in #82).
Overview
Phase 1 of the CTI resurrection epic (Phase 0: #82 / PR #83, merged). PyAutoCTI's visualization layer still targets the autoarray Plotter/MatPlot/Visuals/Include object API that was removed from the stack, and is currently quarantined (
autocti.plotdetached, visualizers no-op with a logged warning, plot tests skipped). This phase rewrites it on the matplotlib function API used by PyAutoGalaxy/PyAutoLens and removes the quarantine.Plan
autocti/plot/abstract_plotters.py,autocti/plot/get_visuals/, 5 Plotter classes, 3 PlotterInterface classes.autogalaxy/imaging/plot/fit_imaging_plots.py:dataset_1d/plot/{dataset_1d_plots,fit_plots}.py(1D line figures/subplots) andcharge_injection/plot/{imaging_ci_plots,fit_ci_plots}.py(2D figures/subplots + 1D binned FPR/EPER region plots).wrapobjects) become CTI-local matplotlib helpers inautocti/util/plot_utils.py.autocti/plot/__init__.pyas the function namespace (aplt.subplot_*); restorefrom . import plotinautocti/__init__.py.model/visualizer.pyclasses onto the new functions perconfig/visualize/plots.yaml(drop the Phase-0 try/except quarantine); align plots.yaml schema with current ag where keys overlap.collect_ignorefromtest_autocti/conftest.py.Out of scope: aggregator factor-graph port (Phase 2), CI/ecosystem plumbing (Phase 3), workspace update (Phase 4).
Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/cti-resurrection-phase1Implementation Steps
Dataset1DPlotter.figures_1d/subplot_dataset,FitDataset1DPlotter,ImagingCIPlotter.figures_2d/figures_1d(region=…)/subplot_dataset,FitImagingCIPlotter, the three PlotterInterfaces' plots.yaml-driven orchestration).autocti/util/plot_utils.py: 1D line/subplot helpers, 2D array helpers delegating toautoarray.structures.plot.structure_plots(plot_array_2d,plot_yx_1d) +autoarray.plot.utils(subplots, save/output helpers), and the CTI region-overlay helpers.*_plots.pyfunction modules (subplot + individual figures + fits output where the old stack had them).autocti/plot/__init__.py; restore the package import; delete the dead files.dataset_1d/model/visualizer.py+charge_injection/model/visualizer.pyto call the new functions, honoringconfig/visualize/plots.yaml; sync yaml keys.Key Files
autocti/plot/— namespace rebuild; object stack deletedautocti/{dataset_1d,charge_injection}/plot/*— new function modulesautocti/{dataset_1d,charge_injection}/model/visualizer.py— rewireautocti/util/plot_utils.py— new helpers (region overlays)autocti/config/visualize/plots.yaml— schema synctest_autocti/conftest.py— remove collect_ignoreOriginal Prompt
PyAutoMind prompt:
draft/feature/autocti/cti_resurrection_phase1_viz_migration.md(epic origin verbatim in #82).