From fc0f6a146f219973a5b6995288cc99c2680ad45d Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 15 May 2026 14:05:05 +0100 Subject: [PATCH] fix: unpark ellipse example scripts after JAX refactor The five `scripts/ellipse/*` examples were parked on 2026-04-24 in config/build/no_run.yaml pending the ellipse JAX refactor in PyAutoGalaxy. That refactor has now shipped (PyAutoGalaxy #408 / #410 / #412, all merged 2026-05-14), and all five scripts (simulator, fit, modeling, multipoles, database) now pass under PYAUTO_TEST_MODE=2. Also patch a leftover `path.exists(...)` / `os.remove(...)` in scripts/ellipse/database.py (the `os.path -> pathlib` refactor removed the `path` import but missed two call sites) with `Path(...).exists()` and `.unlink()`. Paired with PyAutoFit #1270 (Drawer.from_dict fix surfaced by the aggregator scrape in database.py). Co-Authored-By: Claude Opus 4.7 (1M context) --- config/build/no_run.yaml | 5 ----- scripts/ellipse/database.py | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config/build/no_run.yaml b/config/build/no_run.yaml index 1ec182e1..b9cf2cae 100644 --- a/config/build/no_run.yaml +++ b/config/build/no_run.yaml @@ -26,11 +26,6 @@ - fits_make # Test mode does not output .fits images. - png_make # Test mode does not output .png images. - examples/searches # Test mode breaks search visualization. -- ellipse/simulator # NEEDS_FIX 2026-04-24 - all ellipse examples parked pending JAX refactor; see PyAutoPrompt/autogalaxy/ellipse_no_run.md -- ellipse/fit # NEEDS_FIX 2026-04-24 - all ellipse examples parked pending JAX refactor; see PyAutoPrompt/autogalaxy/ellipse_no_run.md -- ellipse/modeling # NEEDS_FIX 2026-04-24 - all ellipse examples parked pending JAX refactor; see PyAutoPrompt/autogalaxy/ellipse_no_run.md -- ellipse/multipoles # NEEDS_FIX 2026-04-24 - all ellipse examples parked pending JAX refactor; see PyAutoPrompt/autogalaxy/ellipse_no_run.md -- ellipse/database # NEEDS_FIX 2026-04-24 - all ellipse examples parked pending JAX refactor; see PyAutoPrompt/autogalaxy/ellipse_no_run.md - imaging/data_preparation/manual/mask_irregular # NEEDS_FIX 2026-04-10 - silent failure, needs investigation - imaging/features/pixelization/modeling # NEEDS_FIX 2026-04-10 - LinAlgError: matrix not positive definite in pixelization modeling - autogalaxy_workspace/scripts/imaging/modeling # NEEDS_FIX 2026-04-10 - KeyError on ('galaxies','galaxy','bulge','ell_comps'...) kwargs after API drift in top-level imaging/modeling.py diff --git a/scripts/ellipse/database.py b/scripts/ellipse/database.py index 103c34c8..8242ce9a 100644 --- a/scripts/ellipse/database.py +++ b/scripts/ellipse/database.py @@ -45,8 +45,9 @@ """ database_name = "ellipse" -if path.exists(Path("output") / f"{database_name}.sqlite"): - os.remove(Path("output") / f"{database_name}.sqlite") +sqlite_path = Path("output") / f"{database_name}.sqlite" +if sqlite_path.exists(): + sqlite_path.unlink() agg = af.Aggregator.from_database( filename=f"{database_name}.sqlite", completed_only=False @@ -237,8 +238,9 @@ """ database_name = "ellipse_multipole" -if path.exists(Path("output") / f"{database_name}.sqlite"): - os.remove(Path("output") / f"{database_name}.sqlite") +sqlite_path = Path("output") / f"{database_name}.sqlite" +if sqlite_path.exists(): + sqlite_path.unlink() agg = af.Aggregator.from_database( filename=f"{database_name}.sqlite", completed_only=False