Skip to content

fix: Register dataset FITS products for database-backed searches #744

Closed

Description

@Jammy2211

Overview

Use the paths API for persistence in Galaxy and Lens. Check database and directory round trips, mask headers and imaging equivalents.

Approved plan

Reproduce on main and fix on feature/database-dataset-fits. Run the regression checks below. Leave PRs open for maintainer review.

Original prompt

Development details and acceptance criteria

Database-path searches cannot reload dataset.fits (written to disk, never registered via save_fits)

Type: bug
Target: PyAutoGalaxy
Repos:

  • PyAutoGalaxy
  • PyAutoLens
    Themes:
  • aggregator
  • interferometer
  • database
    Difficulty: small
    Autonomy: supervised
    Priority: low
    Status: draft
    Consequence: glance
    Witness: an AnalysisInterferometer (and imaging analogue, if affected) run under af.DatabasePaths reloads its dataset through Fit.value("dataset") — the aggregator's _interferometer_from and agg_util.mask_header_from succeed on a database Fit — with the same dataset the directory-paths run reloads.
    Review-minutes: 3
    Unattended: ready
    Lane: any

Found 2026-09-30 by the Codex review of streaming phase 2 (PyAutoGalaxy#638). AnalysisInterferometer.save_attributes
(autogalaxy/interferometer/model/analysis.py, and the autolens mirror) writes dataset.fits straight to
paths.image_path and never registers it through DatabasePaths.save_fits, so under database paths Fit.value("dataset")
returns None (database Fit.value does not scan the image directory, unlike SearchOutput) and
agg_util.mask_header_from fails on [0]. Pre-existing (the in-memory path has always done this); the phase-2
array-free branch inherits it. Fix: route the HDU list through paths.save_fits(name="dataset", hdu_list=...)
(check the PyAutoFit API) so both path types see it, and add a database-paths round-trip test.

Activity

  1. Jammy2211 commented on Nov 22, 2026

    @Jammy2211
    CollaboratorAuthor

    Open for maintainer review:

    Imaging, in-memory interferometry and array-free interferometry now round-trip through SQLite and directory searches. Repeated saves retain one registered dataset. The final Galaxy and Lens sources passed 25 and 22 focused tests; the Lens tests include a run against pre-change Galaxy main.

  2. Jammy2211 commented on Nov 22, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    Dataset FITS products now round-trip through SQLite and directory-backed imaging and interferometer searches. Repeated saves keep one registration. Tests covered imaging plus in-memory and array-free interferometry in both libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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