Overview
Final leg of the aggregator profiling arc (#1375 A–D + awt#171 merged): only AggregateCSV of the three catalogue workflow aggregators was profiled and sped up (−25% in #1376). AggregateImages (png_make) and AggregateFITS (fits_make) were never measured — and code reading already shows AggregateFITS._hdus re-opens the same fits file once per requested HDU via result.value(...) (an uncached fits.open per HDU) and never closes handles.
Plan
- Harness (autofit_workspace_test): give mock templates realistic payloads — a panelled
subplot_fit.png and a multi-HDU fit.fits — and add aggregate_images (output_to_folder, the png_make pattern) + aggregate_fits (extract_fits + output_to_folder, the fits_make pattern) stages to the profiling grid.
- Baseline, then low-hanging fruit in
autofit/aggregator/summary/aggregate_images.py / aggregate_fits.py (candidates: one fits.open per source file per result; close handles; avoid repeated result.value lookups). Behaviour-preserving; before/after in the PR.
- Out of scope: faster single-file deserialization (known deeper follow-up).
Worktree: ~/Code/PyAutoLabs-wt/aggregate-images-fits/ · Branch: feature/aggregate-images-fits · Repos: PyAutoFit (primary), autofit_workspace_test — both clean on main, unclaimed.
Overview
Final leg of the aggregator profiling arc (#1375 A–D + awt#171 merged): only
AggregateCSVof the three catalogue workflow aggregators was profiled and sped up (−25% in #1376).AggregateImages(png_make) andAggregateFITS(fits_make) were never measured — and code reading already showsAggregateFITS._hdusre-opens the same fits file once per requested HDU viaresult.value(...)(an uncachedfits.openper HDU) and never closes handles.Plan
subplot_fit.pngand a multi-HDUfit.fits— and addaggregate_images(output_to_folder, the png_make pattern) +aggregate_fits(extract_fits+output_to_folder, the fits_make pattern) stages to the profiling grid.autofit/aggregator/summary/aggregate_images.py/aggregate_fits.py(candidates: onefits.openper source file per result; close handles; avoid repeatedresult.valuelookups). Behaviour-preserving; before/after in the PR.Worktree:
~/Code/PyAutoLabs-wt/aggregate-images-fits/· Branch:feature/aggregate-images-fits· Repos: PyAutoFit (primary), autofit_workspace_test — both clean on main, unclaimed.