Skip to content

fix: unpark ellipse example scripts after JAX refactor #72

Description

@Jammy2211

Overview

The five ellipse example scripts under autogalaxy_workspace/scripts/ellipse/ (simulator, fit, modeling, multipoles, database) were parked on 2026-04-24 in config/build/no_run.yaml pending a JAX refactor of the ellipse code. That refactor has now landed in PyAutoGalaxy via three merged PRs (#408 ellipse-xp, #410 fit-ellipse-jax, #412 analysis-ellipse-jax, all completed 2026-05-14). This task verifies the scripts pass under PYAUTO_TEST_MODE=2, fixes any remaining API drift, and removes the NEEDS_FIX markers.

Plan

  • Try each of the five ellipse example scripts under PYAUTO_TEST_MODE=2 first — some may simply pass now thanks to the stronger sampler bypass and the refactor.
  • For scripts that still fail, investigate and fix the underlying bug (most likely candidate is modeling.py with a KeyError on ellipses.0.centre_0 kwargs after API drift, and the previous multipoles.py timeout).
  • Remove each script's entry from autogalaxy_workspace/config/build/no_run.yaml once it passes.
  • If ellipse/database passes, also remove the fallback entry from PyAutoBuild/autobuild/config/no_run.yaml (autogalaxy section) so the mega-run no longer skips it.
  • Re-run the workspace mega-run via run_all_scripts.sh and confirm no NEEDS_FIX 2026-04-24 banner remains for any ellipse entry.
Detailed implementation plan

Affected Repositories

  • autogalaxy_workspace (primary)
  • PyAutoBuild (secondary — one-line removal in config/no_run.yaml, only if ellipse/database passes)

Work Classification

Workspace

Branch Survey

Repository Current Branch Dirty?
./autogalaxy_workspace main dirty in dataset/imaging/* and dataset/interferometer/* — looks like leftover simulator regen artifacts (FITS/JSON/PNG), unrelated to this task. Will be sidestepped by working in a worktree off origin/main.
./PyAutoBuild main clean

Suggested branch: feature/unpark-ellipse-scripts
Worktree root: ~/Code/PyAutoLabs-wt/unpark-ellipse-scripts/ (created later by /start_workspace)

Implementation Steps

  1. Worktree both repos to feature/unpark-ellipse-scripts off origin/main under ~/Code/PyAutoLabs-wt/unpark-ellipse-scripts/.
  2. For each of the five ellipse scripts, run from the worktreed workspace:
    cd ~/Code/PyAutoLabs-wt/unpark-ellipse-scripts/autogalaxy_workspace
    PYAUTO_TEST_MODE=2 python scripts/ellipse/<name>.py
    in this order: simulator.py, fit.py, modeling.py, multipoles.py, database.py.
  3. For any script that still fails, diagnose and fix. Known candidates flagged in the original prompt:
    • modeling.py: KeyError on ellipses.0.centre_0 kwargs — likely model-component path drift after the JAX refactor; check Model composition vs. the post-refactor Ellipse class layout.
    • modeling.py and multipoles.py: timed out under TEST_MODE=1 in the mega-run — TEST_MODE=2 bypasses the sampler more aggressively and may resolve this.
  4. As each script passes, remove its - ellipse/<name> # NEEDS_FIX 2026-04-24 … line from autogalaxy_workspace/config/build/no_run.yaml.
  5. If ellipse/database passes, also remove the line - ellipse/database # Ellipse model needs refactor and JAX support from the autogalaxy: section of PyAutoBuild/autobuild/config/no_run.yaml.
  6. Re-run the mega-run via autogalaxy_workspace/run_all_scripts.sh (or the relevant /smoke_test invocation) and confirm:
    • No ellipse entry shows a NEEDS_FIX banner.
    • All five ellipse scripts complete cleanly.
  7. Ship via /ship_workspace with cross-reference comment back to this issue.

Key Files

  • autogalaxy_workspace/config/build/no_run.yaml — remove 5 ellipse/* lines
  • autogalaxy_workspace/scripts/ellipse/{simulator,fit,modeling,multipoles,database}.py — fix any remaining API drift / xp call-site bugs
  • PyAutoBuild/autobuild/config/no_run.yaml — possibly remove - ellipse/database line in autogalaxy: section

Original Prompt

Click to expand starting prompt
  • All ellipse example scripts under autogalaxy_workspace/scripts/ellipse/ are currently in
    autogalaxy_workspace/config/build/no_run.yaml with a NEEDS_FIX 2026-04-24 marker.

    The five entries are:

    • ellipse/simulator
    • ellipse/fit
    • ellipse/modeling
    • ellipse/multipoles
    • ellipse/database

    They were parked because the ellipse model needs a refactor and JAX support (tracked separately in
    PyAutoPrompt/autogalaxy/ellipse_fitting_jax.md). In particular, ellipse/modeling and
    ellipse/multipoles time out under PYAUTO_TEST_MODE=1 in the mega-run, and
    ellipse/modeling additionally raises a KeyError on ellipses.0.centre_0 kwargs after API drift.

    When the JAX refactor lands:

    1. Try running each ellipse script with PYAUTO_TEST_MODE=2 first — some may just need the
      stronger sampler bypass.
    2. Remove the five ellipse/* lines from autogalaxy_workspace/config/build/no_run.yaml.
    3. If the refactor also unlocks aggregator-style usage, the ellipse/database entry in
      PyAutoBuild/autobuild/config/no_run.yaml (the fallback list) can be removed too.
    4. Re-run the mega-run (run_all_script_fix_failures skill in autogalaxy_workspace) to confirm
      every ellipse script passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions