Skip to content

fix: write dataset.fits once, always, to image/ (drop fits_dataset knob) - #731

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/dataset-fits-image-only
Sep 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/dataset-fits-image-only

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Every imaging and interferometer search has written dataset.fits twice since PyAutoGalaxy#479 / #574: files/dataset.fits unconditionally from save_attributes (via paths.save_fits), and an identical image/dataset.fits from the plotter interface gated on visualize/plots.yaml dataset.fits_dataset. Spotted in a Euclid vis_lp output folder; generic library behaviour.

This PR makes dataset.fits a single, always-written file under image/: AnalysisImaging.save_attributes and AnalysisInterferometer.save_attributes write it directly to paths.image_path and skip the write when the file already exists (a resumed search does not rewrite it). The fits_dataset-gated plotter writes and the fits_dataset config key are removed. autofit.aggregator.SearchOutput already scans image/ for .fits, so fit.value(name="dataset") and the *Agg loaders are unchanged.

Not touched: PyAutoFit. Known trade-off: DatabasePaths.save_fits no longer receives dataset from save_attributes (the pre-#574 behaviour); an image-folder-aware save_fits in PyAutoFit can follow if the database route needs it.

Tracked in PyAutoLabs/PyAutoGalaxy#608 (companion to the PyAutoGalaxy PR).

API Changes

  • visualize/plots.yaml dataset.fits_dataset is removed — dataset.fits is always written, once, to the search's image/ folder. Workspace config/visualize/plots.yaml copies should drop the key (workspace follow-up PRs).
  • dataset.fits is no longer written to files/; readers that hard-coded files/dataset.fits should read image/dataset.fits (the aggregator needs no change).
    See full details below.

Test Plan

  • pytest test_autolens/analysis test_autolens/imaging test_autolens/interferometer
  • A fit's output has exactly one dataset.fits, under image/, none under files/
  • af.Aggregator.from_directory(...) + al.agg.ImagingAgg(agg).dataset_gen_from() round-trips the dataset
Full API Changes (for automation & release notes)

Removed

  • config/visualize/plots.yaml key dataset.fits_dataset — the output is unconditional now.
  • (Plotter writes live in PyAutoGalaxy; see PyAutoLabs/PyAutoGalaxy PR.)

Changed

  • AnalysisImaging.save_attributes, AnalysisInterferometer.save_attributes — write image/dataset.fits (was files/dataset.fits), skipped when the file exists.

Migration

  • Before: dataset.fits under both files/ and image/; fits_dataset: true in plots.yaml.
  • After: image/dataset.fits only; delete the fits_dataset line from any copied plots.yaml.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Giskz46AjniG7E9dKxwpTG

…ob) (PyAutoGalaxy#608)

Since PyAutoGalaxy#479 / #574 every imaging/interferometer search wrote dataset.fits twice with
identical contents: files/dataset.fits unconditionally from save_attributes via
paths.save_fits, and image/dataset.fits from the plotter gated on the
visualize plots.yaml `dataset.fits_dataset` setting.

save_attributes now writes image/dataset.fits directly (paths.image_path),
skipping the write when the file already exists (resumed search). The gated
plotter writes and the `fits_dataset` config key are removed. The aggregator
already scans image/ for .fits, so fit.value(name="dataset") is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Giskz46AjniG7E9dKxwpTG
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

@Jammy2211
Jammy2211 merged commit 7d1b04d into main Sep 8, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/dataset-fits-image-only branch September 8, 2026 18:19
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant