Skip to content

test: re-port adapt-image jax likelihood scripts after pytree fix#12

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/adapt-images-pytree-fix
Apr 26, 2026
Merged

test: re-port adapt-image jax likelihood scripts after pytree fix#12
Jammy2211 merged 1 commit into
mainfrom
feature/adapt-images-pytree-fix

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Re-enables adapt-image jax likelihood smoke tests for autogalaxy under scripts/jax_likelihood_functions/imaging/. Restores the adapt variant of rectangular.py (previously a RectangularUniform + Constant placeholder while the library bug was open) and adds three new scripts ported from the autolens equivalents: rectangular_mge.py, delaunay.py, delaunay_mge.py. Re-enables the first three in smoke_tests.txt; delaunay_mge.py is committed but left commented in the smoke list to mirror the autolens deferral for the JAX 0.7 regression.

rectangular_mge.py is the multi-galaxy regression case the path-tuple library fix was made for. Pre-fix, the autolens single-pixelized-galaxy fallback would silently return the wrong adapt image whenever multiple pixelizations are present in the same fit; this script catches that.

Scripts Changed

  • scripts/jax_likelihood_functions/imaging/rectangular.py — restored adapt variant: RectangularAdaptImage + Adapt regularization, single galaxy. Replaces the placeholder.
  • scripts/jax_likelihood_functions/imaging/rectangular_mge.pynew. Two galaxies: MGE bulge + RectangularAdaptImage + Constant. Multi-pixelization regression test.
  • scripts/jax_likelihood_functions/imaging/delaunay.pynew. Single galaxy with Delaunay mesh + AdaptSplit regularization + Hilbert image-mesh. Exercises the image_plane_mesh_grid_for_galaxy lookup helper.
  • scripts/jax_likelihood_functions/imaging/delaunay_mge.pynew. Two galaxies: MGE bulge + Delaunay + MaternAdaptKernel + Hilbert. Committed but commented in smoke_tests.txt to mirror autolens deferral. Local run passes — re-enable when autolens does.
  • smoke_tests.txt — re-enables rectangular_mge.py, delaunay.py; commented entry for delaunay_mge.py matching the autolens jax-0.7 note.

Upstream PR

This workspace PR is library-blocked — its CI installs autogalaxy from main, which won't have the new AdaptImages.image_for_galaxy helper until #370 is merged.

Test Plan

  • Smoke tests pass for all three re-enabled scripts (rectangular.py, rectangular_mge.py, delaunay.py).
  • After PyAutoGalaxy #370 merges, GitHub Actions CI for this PR is green.
  • Manual local verification: source activate.sh && python scripts/jax_likelihood_functions/imaging/delaunay_mge.py passes locally even though it's commented in the smoke list (sanity check that the script itself is correct, not the JAX 0.7 environment).

🤖 Generated with Claude Code

Adds rectangular_mge.py, delaunay.py, delaunay_mge.py and restores the
adapt variant of rectangular.py under
scripts/jax_likelihood_functions/imaging/. Re-enables them in
smoke_tests.txt; delaunay_mge.py is left commented out to mirror the
autolens deferral for the JAX 0.7 regression.

rectangular_mge.py is the multi-galaxy regression case the path-tuple
library fix was made for: prior to PR #370 the autolens single-pixelized-
galaxy fallback would silently return the wrong adapt image for the
multi-pixelization case.

Depends on PyAutoGalaxy #370 and PyAutoLens #474.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Apr 26, 2026
@Jammy2211 Jammy2211 merged commit 2be859a into main Apr 26, 2026
3 of 4 checks passed
@Jammy2211 Jammy2211 deleted the feature/adapt-images-pytree-fix branch April 26, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant