Skip to content

fix: xp-gate jax.scipy.special.factorial in shapelets/exponential.py#385

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/xp-gate-shapelets-exponential
May 1, 2026
Merged

fix: xp-gate jax.scipy.special.factorial in shapelets/exponential.py#385
Jammy2211 merged 1 commit into
mainfrom
feature/xp-gate-shapelets-exponential

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

  • autogalaxy/profiles/light/standard/shapelets/exponential.py:90 did an unconditional from jax.scipy.special import factorial inside image_2d_from, breaking library CI with ModuleNotFoundError: No module named 'jax' (failing test: test_autogalaxy/profiles/light/shapelets/test_exponential.py::test__image_2d_from__elliptical__ell_comps_0p1_0p2__correct_values).
  • Applies the same if xp is np gate that already exists in sibling modules cartesian.py (lines 104-108) and polar.py (lines 152-157). NumPy path uses scipy.special.factorial, JAX path uses jax.scipy.special.factorial.

Test plan

  • pytest test_autogalaxy/profiles/light/shapelets/test_exponential.py — 4 passed.
  • PyAutoBuild CI green.

🤖 Generated with Claude Code

The unconditional `from jax.scipy.special import factorial` inside
ShapeletExponential.image_2d_from broke library CI with
ModuleNotFoundError when JAX is absent. Sibling modules cartesian.py
and polar.py already gate this import with `if xp is np`; this applies
the same pattern to exponential.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@Jammy2211 Jammy2211 merged commit 987f61c into main May 1, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/xp-gate-shapelets-exponential branch May 1, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant