Skip to content

docs: combine guides/results start_here.py files (simple + aggregator) #95

@Jammy2211

Description

@Jammy2211

Overview

The guides/results/ package currently has two entry-point tutorials: start_here.py (simple JSON/FITS loading, ~140 lines) and aggregator/start_here.py (full aggregator workflow, ~440 lines). Users hitting the results section have to read both to understand the choice between them. This task combines them into a single guides/results/start_here.py for both autogalaxy_workspace and autolens_workspace, with the aggregator introduced as the second half — making it explicit that downstream sections (samples, galaxies, fits, etc.) can be reached through either API.

Plan

  • Combine the two files so a reader sees one entry point that explains:
    1. The simple, instant JSON/FITS loading workflow (current content of start_here.py).
    2. A clear pivot: "for many fits, use the aggregator instead — same objects, generator-based."
    3. The aggregator workflow itself (current content of aggregator/start_here.py), with each section noting that the result can also be reached via the simple-loading API where applicable.
  • Drop the duplicate model-fit illustration so the merged file uses the JSON/FITS-loaded objects as the running example, falling back to the small in-script fit only where the aggregator illustration genuinely needs it.
  • Delete the now-redundant guides/results/aggregator/start_here.py.
  • Update internal cross-references in sibling files (samples.py, models.py, data_fitting.py, galaxies_fit(s).py, interferometer.py, queries.py, samples_via_aggregator.py) so any "see aggregator/start_here.py" pointer is rewritten to "see results/start_here.py — Aggregator section".
  • Update __Contents__ block at the top of the merged file to reflect both halves.
  • Mirror identical structure across both workspaces (autogalaxy uses Galaxies, autolens uses Tracer — content shape stays parallel).
Detailed implementation plan

Affected Repositories

  • autolens_workspace (primary)
  • autogalaxy_workspace

Work Classification

Workspace

Branch Survey

Repository Current Branch Dirty?
./autolens_workspace main clean
./autogalaxy_workspace main clean

Suggested branch: feature/merge-results-start-here
Worktree root: ~/Code/PyAutoLabs-wt/merge-results-start-here/ (created later by /start_workspace)

Implementation Steps

  1. Rewrite autolens_workspace/scripts/guides/results/start_here.py as a single tutorial in two halves:

    • Simple loading (existing 145 lines, mostly preserved): docstring → result_path → tracer (from JSON) → model → samples → FITS files.
    • Aggregator pivot (new bridging paragraph): "Everything above loaded one fit at a time. To analyse many fits, use the aggregator." Note that you can keep using samples, tracer, model etc., just sourced from a generator.
    • Aggregator (adapted from current aggregator/start_here.py): keep the in-script Aggregator.from_directory(...) setup, generators explanation, database-file note, workflow examples, then the deeper sections (Result, Samples, Linear Light Profiles, Galaxies, Fits, Units & Cosmology, Linear Light Profiles / Basis, Pixelization). Where each section is parallel to the simple-loading API, add a one-line "(equivalent to from_json(...).tracer above)" note.
  2. Rewrite autogalaxy_workspace/scripts/guides/results/start_here.py with the same merge, using Galaxies instead of Tracer, ag.Imaging instead of al.Imaging, etc. Keep section structure parallel to autolens version.

  3. Delete obsolete files:

    • autogalaxy_workspace/scripts/guides/results/aggregator/start_here.py
    • autolens_workspace/scripts/guides/results/aggregator/start_here.py
  4. Update sibling references — grep both aggregator/ subfolders for "start_here.py" pointers and rewrite them to point at guides/results/start_here.py with a section anchor (e.g. "see results/start_here.py § Aggregator").

  5. Verify:

    • Run bash run_all_scripts.sh (or /run_all_script_fix_failures) on both workspaces in test mode.
    • Run scripts/check_sizes.sh after edits — start_here.py will grow ~3×, aggregator/start_here.py will be deleted (refresh snapshot to register the deletion via --update).
    • Re-generate notebooks via /generate_and_merge once code is approved.

Key Files

  • autolens_workspace/scripts/guides/results/start_here.py — rewrite (combined ~520 lines)
  • autolens_workspace/scripts/guides/results/aggregator/start_here.py — delete
  • autogalaxy_workspace/scripts/guides/results/start_here.py — rewrite (combined ~500 lines)
  • autogalaxy_workspace/scripts/guides/results/aggregator/start_here.py — delete
  • Sibling files in both aggregator/ subfolders — update internal start_here.py cross-references

Original Prompt

Click to expand starting prompt

Can you combine guides/results/start_here.py and guides/results/aggregator/start_here.py into one,
at guides/results/start_here.py, for both autogalaxy_workspace and autolens_workspace.

I think its fine for the aggregator to be eplxained in the first results start_here.py file, after we introduce
the simple json loading, and make it clear steps like using the samples can be done using either API.

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