Repository navigation
Description
Overview
With PYAUTO_FAST_PLOTS=1, autocti's fits_fit writes fit.fits into an image/fit_dataset/ folder that nothing has created yet, so every model fit with visualization on crashes with FileNotFoundError. Until this is fixed, the autocti_workspace release profile keeps FAST_PLOTS off. This is cti-upkeep phase 3.
Plan
- Both autocti FITS writers create their output folder before writing
fit.fits. - A unit test reproduces the crash first (it must fail on current main).
- After the library PR merges, the autocti_workspace release profile goes back to
PYAUTO_FAST_PLOTS: "1", and the 3 smoke scripts must pass that way (the Witness). - Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary (library first, then workspace)
Detailed implementation plan
Affected Repositories
- PyAutoLabs/PyAutoCTI (primary)
- PyAutoLabs/autocti_workspace
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./cti/PyAutoCTI | main | clean |
| ./cti/autocti_workspace | main | clean |
Suggested branch: feature/cti-fits-fit-output-dir
Implementation Steps
- Add
Path(output_path).mkdir(parents=True, exist_ok=True)beforehdu_list.writetoinautocti/dataset_1d/plot/fit_plots.py::fits_fitandautocti/charge_injection/plot/fit_ci_plots.py::fits_fit. - One test per writer: call
fits_fitwith a nested folder that doesn't exist yet and assertfit.fitsis written. Control: both fail on main. Then run the fulltest_autoctiserially. - autocti_workspace
config/build/profile_release.yaml:PYAUTO_FAST_PLOTS: "1", drop the workaround comment. Witness: 3/3 smoke scripts pass throughrun_python.pywith that profile.
Original Prompt
Click to expand starting prompt
autocti: fits_fit writes fit.fits into a directory nothing creates when PYAUTO_FAST_PLOTS=1
Type: bug
Target: autocti
Repos:
- autocti
- autocti_workspace
Themes: - cti
- visualization
Difficulty: small
Autonomy: supervised
Priority: normal
Status: formalised
Consequence: glance
Witness: withPYAUTO_TEST_MODE=1 PYAUTO_SKIP_VISUALIZATION=0 PYAUTO_FAST_PLOTS=1,scripts/dataset_1d/modeling/start_here.pyandscripts/imaging_ci/modeling/start_here.pyin autocti_workspace run to completion and writeimage/fit_dataset/fit.fits; autocti_workspaceconfig/build/profile_release.yamlflips back toPYAUTO_FAST_PLOTS: "1".
Review-minutes: 3
Unattended: ready
Epic: cti-upkeep
Phase: 3
What happens
Found 2026-11-05 while adding autocti_workspace config/build/profile_release.yaml
for the release train (PyAutoHands#332). All 3 smoke_tests.txt scripts fail
under the release profile with FAST_PLOTS on:
FileNotFoundError: .../output/test_mode/dataset_1d/simple/species[x2]/<hash>/analyses/analysis_0/image/fit_dataset/fit.fits
autocti/dataset_1d/model/plotter.py:202 fit_plots.fits_fit(fit=fit, output_path=output_path)
autocti/dataset_1d/plot/fit_plots.py:216 hdu_list.writeto(Path(output_path) / "fit.fits", ...)
output_path is the image_path / "fit_dataset" subfolder. It only gets created as a
side effect of autoarray.plot.utils.subplot_save saving a figure. With
PYAUTO_FAST_PLOTS=1 that function returns before it creates the directory, so the
FITS write fails. PyAutoGalaxy avoids this because its base plotter image_path
calls os.makedirs, and its fits writers target that path directly.
Fix
Create the directory before the write in both FITS writers:
autocti/dataset_1d/plot/fit_plots.py::fits_fit and
autocti/charge_injection/plot/fit_ci_plots.py::fits_fit (or make the CTI plotters'
subfolder paths mkdir(parents=True, exist_ok=True)). Add a unit test that calls
fits_fit with a non-existent output directory. Then set the release profile's
FAST_PLOTS back to "1" (the temporary workaround comment points here).
Activity
Jammy2211 commentedon Nov 5, 2026
Shipped 2026-11-05
fits_fitwriters now create their output folder.PYAUTO_FAST_PLOTS: "1".Witness passed: 3/3 release smoke scripts with FAST_PLOTS on. Independent review: CLEAN. CI is green on both PRs. Glance-tier auto-merge (plan approved 2026-11-05).
🤖 Generated with Claude Code