Skip to content

fix: fits_fit creates its output directory - #120

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cti-fits-fit-output-dir
Nov 5, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cti-fits-fit-output-dir

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

With PYAUTO_FAST_PLOTS=1, subplot_save returns before creating the fit's image subfolder. fits_fit then wrote fit.fits into a folder that didn't exist, so every model fit with visualization on crashed with FileNotFoundError. Both FITS writers now create the folder first:

  • autocti/dataset_1d/plot/fit_plots.py
  • autocti/charge_injection/plot/fit_ci_plots.py

These are the only two writeto calls in autocti outside instruments/, and both model-plotter call sites go through them.

Closes #119 (cti-upkeep phase 3).

API Changes

None. Output folders are now created when missing.

Tests

  • One test per writer calls fits_fit with a nested folder that doesn't exist yet. Both fail on unchanged main with FileNotFoundError and pass with the fix.
  • Full test_autocti (serial): 277 passed.
  • Witness: autocti_workspace profile_release.yaml with PYAUTO_FAST_PLOTS: "1" passes 3/3 smoke scripts through run_python.py against this branch (about 10 s, 9 s and 26 s). The companion autocti_workspace PR follows once this merges.
  • Independent review: CLEAN.

Tier: glance — auto-merge on green with the Witness passed (plan approved by the human 2026-11-05).

🤖 Generated with Claude Code

With PYAUTO_FAST_PLOTS=1, subplot_save returns before creating the fit's image
subfolder, so fits_fit wrote fit.fits into a directory that did not exist and
every model fit with visualization crashed with FileNotFoundError. Both FITS
writers (dataset_1d and charge_injection) now create the folder first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 1cd2f0d into main Nov 5, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/cti-fits-fit-output-dir branch November 5, 2026 16:46
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 5, 2026
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.

fix: fits_fit creates its output directory (crash under PYAUTO_FAST_PLOTS=1)

1 participant