Skip to content

test: skip jax-backed unit tests when jax is absent (Python matrix)#604

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/matrix-jax-skip
Jul 11, 2026
Merged

test: skip jax-backed unit tests when jax is absent (Python matrix)#604
Jammy2211 merged 1 commit into
mainfrom
feature/matrix-jax-skip

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Part of getting the PyAutoBuild Python Version Matrix green. A set of unit tests exercise jax-only code paths (vmapped profiles, blackjax NUTS, the NUFFT sparse operator, use_jax=True) that need jax installed to run. jax ships via the [optional] extras and is present in the per-repo CI (3.12/3.13), so these pass there — but the Python Version Matrix installs the NumPy-only stack (and jax cannot install on 3.9 at all), so they failed with ModuleNotFoundError: No module named 'jax'.

Guards the affected tests with pytest.mark.skipif(importlib.util.find_spec("jax") is None, ...). NumPy-only tests in the same files are untouched. Aligns with the repo doctrine "unit tests are NumPy-only; JAX validated in workspace_test".

Verification

  • jax absent (clean 2026.7.9.1 venv, no [optional]): guarded tests skip, all other tests pass.
  • jax present (dev env): all files collect cleanly, nothing skipped.

Paired across PyAutoArray / PyAutoFit / PyAutoGalaxy / PyAutoLens (feature/matrix-jax-skip); test-only, no library source changed.

🤖 Generated with Claude Code

These tests exercise jax-only code paths (vmapped profiles / blackjax NUTS /
nufft sparse operator / use_jax=True), so they need jax installed to run — it
ships via the [optional] extras and is present in the per-repo CI (3.12/3.13).
The PyAutoBuild Python Version Matrix installs the NumPy-only stack (and jax
can't install on 3.9 anyway), so guard the 5 affected test(s) with a
skipif on jax availability rather than letting them ModuleNotFoundError.
Numpy-only tests in the same files are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 63f9ef9 into main Jul 11, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/matrix-jax-skip branch July 11, 2026 10:54
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