Skip to content

feat: CTI resurrection Phase 1 — Plotter to matplotlib viz migration #84

Description

@Jammy2211

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

  • PyAutoCTI (primary)

Branch Survey

Repository Current Branch Dirty?
./PyAutoCTI main (post-#83 merge, clean) clean

Suggested branch: feature/cti-resurrection-phase1

Implementation Steps

  1. 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).
  2. 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.
  3. Write the four per-domain *_plots.py function modules (subplot + individual figures + fits output where the old stack had them).
  4. Rebuild autocti/plot/__init__.py; restore the package import; delete the dead files.
  5. Rewire dataset_1d/model/visualizer.py + charge_injection/model/visualizer.py to call the new functions, honoring config/visualize/plots.yaml; sync yaml keys.
  6. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions