Summary
The aggregator result guides (guides/results/aggregator/models.py) fail in both autogalaxy_workspace and autolens_workspace with:
PyAutoGalaxy/autogalaxy/aggregator/agg_util.py:101
header = aa.Header(header_sci_obj=fit.value(name=name)[0].header)
TypeError: 'NoneType' object is not subscriptable
Surfaced by the 2026-07-08 full workspace-validation sweep (5 failed / 613 passed).
Root cause
fit.value(name="dataset") returns None: the fit no longer persists the dataset.fits the aggregator loaders require.
Pre-overhaul, AnalysisDataset.save_attributes wrote dataset.fits to the files/ folder unconditionally (before every fit). The "Visualization overhaul: fits API" commit (081bbd84, via 825544bf "move save attributes stuff to plotter interface") removed that write and left only the plotter-interface copy in image/, which is gated on the fits_dataset visualization setting. Any fit that does not emit that visualization output (test-mode / minimal searches / older runs) has no dataset.fits, so ImagingAgg / InterferometerAgg / agg_util.mask_header_from break.
fit.value scans both files/ and image/, so where visualization ran the file is found — the failure is on fits where it did not.
PyAutoLens's analysis never had a save_attributes producer at all (it relied entirely on the visualization copy), so the same gap affects autolens_workspace.
Fix (restore the producer; both libraries)
Re-add an unconditional paths.save_fits(name="dataset", ...) to save_attributes, honouring the documented HDU contract (mask/data/noise_map/psf/over_sample_size_* for imaging; mask/data/noise_map/uv_wavelengths for interferometer), using the current plotter accessors (.native_for_fits, .header_dict):
- PyAutoGalaxy
AnalysisImaging + AnalysisInterferometer.save_attributes
- PyAutoLens
AnalysisImaging (new override) + AnalysisInterferometer.save_attributes
No consumer-side None-guard (fix the producer). The plotter's image/dataset.fits write is unchanged.
Verification
autogalaxy and autolens guides/results/aggregator/models.py both run to completion (exit 0), TypeError gone.
- New regression tests assert
save_attributes writes files/dataset.fits with [MASK, DATA, NOISE_MAP, PSF].
- Existing analysis suites pass (PyAutoGalaxy 5, PyAutoLens 10).
Summary
The aggregator result guides (
guides/results/aggregator/models.py) fail in bothautogalaxy_workspaceandautolens_workspacewith:Surfaced by the 2026-07-08 full workspace-validation sweep (5 failed / 613 passed).
Root cause
fit.value(name="dataset")returnsNone: the fit no longer persists thedataset.fitsthe aggregator loaders require.Pre-overhaul,
AnalysisDataset.save_attributeswrotedataset.fitsto thefiles/folder unconditionally (before every fit). The "Visualization overhaul: fits API" commit (081bbd84, via825544bf"move save attributes stuff to plotter interface") removed that write and left only the plotter-interface copy inimage/, which is gated on thefits_datasetvisualization setting. Any fit that does not emit that visualization output (test-mode / minimal searches / older runs) has nodataset.fits, soImagingAgg/InterferometerAgg/agg_util.mask_header_frombreak.fit.valuescans bothfiles/andimage/, so where visualization ran the file is found — the failure is on fits where it did not.PyAutoLens's analysis never had a
save_attributesproducer at all (it relied entirely on the visualization copy), so the same gap affectsautolens_workspace.Fix (restore the producer; both libraries)
Re-add an unconditional
paths.save_fits(name="dataset", ...)tosave_attributes, honouring the documented HDU contract (mask/data/noise_map/psf/over_sample_size_*for imaging;mask/data/noise_map/uv_wavelengthsfor interferometer), using the current plotter accessors (.native_for_fits,.header_dict):AnalysisImaging+AnalysisInterferometer.save_attributesAnalysisImaging(new override) +AnalysisInterferometer.save_attributesNo consumer-side None-guard (fix the producer). The plotter's
image/dataset.fitswrite is unchanged.Verification
autogalaxyandautolensguides/results/aggregator/models.pyboth run to completion (exit 0),TypeErrorgone.save_attributeswritesfiles/dataset.fitswith[MASK, DATA, NOISE_MAP, PSF].