Skip to content

fix: restore aggregator output contracts #1324

Closed

Description

@Jammy2211

Overview

Release-profile validation exposed seven scripts whose result discovery or generated-output contracts depend on state from earlier runs. Reproduce them from clean output trees, distinguish PyAutoFit regressions from script assumptions, and make every script’s prerequisites explicit and reliable.

Plan

  • Reproduce all seven scripts in release CI order and independently.
  • Classify failures by aggregator discovery, sample assumptions, or output paths.
  • Fix PyAutoFit when valid completed searches are undiscoverable.
  • Otherwise update workspace scripts minimally, preserving tutorial narrative.
  • Add focused tests and rerun the seven-script release surface.
Detailed implementation plan

Affected Repositories

  • PyAutoFit (primary)
  • autogalaxy_workspace
  • autolens_workspace
  • autolens_workspace_test

Work Classification

Both — library investigation first, followed by workspace changes where required.

Branch Survey

Repository Branch State
PyAutoFit main clean
autogalaxy_workspace main generated datasets modified
autolens_workspace main generated datasets modified
autolens_workspace_test main datasets modified; notebooks deleted

No registered worktree conflict exists. Adjacent work is present on feature/latent-jax-release-failures.

Suggested branch: feature/aggregator-output-contracts
Worktree root: ~/Code/PyAutoLabs-wt/aggregator-output-contracts/

Implementation Steps

  1. Create an isolated worktree and reproduce each parent directory from a clean output tree using its release profile.
  2. Rerun each target script independently and document required predecessor outputs.
  3. Inspect PyAutoFit/autofit/aggregator/ and database scraping when completed searches are absent.
  4. Add focused PyAutoFit regression tests only where valid output is incorrectly excluded.
  5. Correct invalid result-count assumptions and create generated-output directories within the responsible workspace scripts.
  6. Preserve user-facing prose and regenerate notebooks for modified tutorial scripts.
  7. Run focused unit tests, script-size guards, and all seven release-profile scripts.
  8. Ship library changes before dependent workspace changes.

Key Files

  • PyAutoFit/autofit/aggregator/aggregator.py
  • PyAutoFit/autofit/aggregator/search_output.py
  • PyAutoFit/autofit/database/aggregator/scrape.py
  • autogalaxy_workspace/scripts/guides/results/start_here.py
  • autogalaxy_workspace/scripts/guides/results/aggregator/samples_via_aggregator.py
  • autolens_workspace/scripts/guides/results/start_here.py
  • autolens_workspace/scripts/guides/results/aggregator/galaxies_fits.py
  • autolens_workspace/scripts/guides/results/aggregator/samples_via_aggregator.py
  • autolens_workspace/scripts/guides/results/workflow/csv_make.py
  • autolens_workspace_test/scripts/imaging/convolution.py

Original Prompt

Click to expand starting prompt

Fix release aggregator and generated-output contracts

Context

Seven release failures involve results that are absent, shorter than examples assume,
or written to a different location. Several pass in a stateful local checkout, so the
first task is a clean, directory-ordered reproduction. Primary owners are @PyAutoFit,
@autogalaxy_workspace, @autolens_workspace, and @autolens_workspace_test.

Scripts

  • autogalaxy_workspace/scripts/guides/results/start_here.py
  • autogalaxy_workspace/scripts/guides/results/aggregator/samples_via_aggregator.py
  • autolens_workspace/scripts/guides/results/start_here.py
  • autolens_workspace/scripts/guides/results/aggregator/galaxies_fits.py
  • autolens_workspace/scripts/guides/results/aggregator/samples_via_aggregator.py
  • autolens_workspace/scripts/guides/results/workflow/csv_make.py
  • autolens_workspace_test/scripts/imaging/convolution.py

Required work

  1. Run each parent directory in CI order from a clean output tree under the release
    profile, then rerun each script independently to document prerequisites.
  2. Determine whether failures are library output/aggregator regressions, invalid script
    assumptions about sample counts, or missing directory creation for generated files.
  3. Fix PyAutoFit when valid completed searches are not discoverable. Otherwise update
    scripts minimally while preserving their teaching narrative.
  4. Ensure scripts create their own output directories and do not depend on unrelated
    earlier legs or developer-local artifacts.
  5. Add the narrowest appropriate tests and rerun all seven release-profile scripts.

Activity

  1. Jammy2211 commented on Jul 6, 2026

    @Jammy2211
    CollaboratorAuthor

    Library PR Created

    PYAUTO_TEST_MODE=0 now uses the normal output tree; active test levels remain namespaced under output/test_mode/.

    Next: ship the release-profile and generated-output fixes in the affected workspaces.

  2. Jammy2211 commented on Jul 6, 2026

    @Jammy2211
    CollaboratorAuthor

    Smoke Test Results — 2026-07-06

    Workspace Passed Failed Total
    autogalaxy_workspace 8 0 8
    autolens_workspace 9 0 9
    autolens_workspace_test 15 0 15

    All 32 smoke tests passed. The seven release-profile target scripts also pass independently from clean generated-output trees.

    Workspace PRs:

  3. Jammy2211 commented on Jul 7, 2026

    @Jammy2211
    CollaboratorAuthor

    Update: PyAutoFit PR #1326 was closed as unnecessary for this fix. The workspace release profiles now unset PYAUTO_TEST_MODE for guides/results instead of setting PYAUTO_TEST_MODE=0. The remaining fix is in the workspace PRs, primarily retaining the 300 quick-fit samples and keeping results guides out of PyAuto test mode.

  4. Jammy2211 commented on Jul 7, 2026

    @Jammy2211
    CollaboratorAuthor

    Follow-up pushed to the workspace PRs: the results workflow examples now reuse scripts/guides/results/_quick_fit.py instead of maintaining their own two-fit setup. The helper now creates two fits in output/results_folder, includes the latent outputs needed by csv_make.py, and disables fast-plot skipping so png_make.py / fits_make.py have fit.png and fit.fits available. The workflow examples now use results_folder instead of results_folder_csv_png_fits.

  5. Jammy2211 commented on Jul 7, 2026

    @Jammy2211
    CollaboratorAuthor

    Follow-up correction: removed workspace-side test-mode path handling from the results scripts. The workspace examples now use plain output/results_folder paths; the release/smoke env config is responsible for running these guides outside PYAUTO_TEST_MODE. PyAutoFit remains the owner of test-mode output routing when test mode is actually enabled.

  6. Jammy2211 commented on Jul 7, 2026

    @Jammy2211
    CollaboratorAuthor

    Merged the workspace fixes for the aggregator output contracts.

    PRs merged:

    Fix summary:

    • Centralised Autogalaxy and Autolens results/workflow examples on _quick_fit.py so the examples share one setup path.
    • _quick_fit.py now generates two release-mode fits in output/results_folder, keeps the full Nautilus sample output, writes the required CSV/PNG/FITS artefacts, and includes the latent summaries used by the aggregator examples.
    • Removed workspace-side test-mode path handling from user-facing results scripts; they now use plain output/results_folder.
    • Release smoke configuration unsets PYAUTO_TEST_MODE for the results guides, so these examples generate real n_like_max=300 Nautilus outputs instead of one-sample test-mode outputs.
    • Fixed the Autolens result FITS reload noise-map validation case.
    • Fixed the autolens_workspace_test convolution image directory creation issue.
    • Closed fix: treat test mode zero as disabled #1326 as unnecessary; no PyAutoFit change was needed for this issue.

    Fresh smoke after clearing output passed:

    • autogalaxy_workspace: 8/8
    • autolens_workspace: 9/9
    • autolens_workspace_test: 15/15
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