test: skip default-nufftax interferometer tests when nufftax absent (py<3.12)#382
Merged
Conversation
The default Interferometer transformer is the JAX-native TransformerNUFFT, backed by nufftax (declared for Python >= 3.12 only). On 3.9-3.11 (not officially supported) the backend can't install, so default interferometer / transformer tests raise ModuleNotFoundError at construction. Add a pytest_collection_modifyitems hook that skips exactly those when nufftax is unavailable, keeping the explicit DFT and pynufft transformer tests. On 3.12/3.13 nothing is skipped. Fixes the PyAutoBuild Python Version Matrix red on 3.9-3.11 (paired with PyAutoArray[optional] in that workflow). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
Paired with PyAutoBuild#144 (adds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of fixing the Python Version Matrix red (PyAutoBuild weekly). The default
Interferometertransformer is the JAX-nativeTransformerNUFFT, backed bynufftax— declared for Python ≥ 3.12 only (3.9–3.11 are not officially supported;general.yaml). On those interpreters the backend can't install, so every test that builds a default interferometer/transformer raisedModuleNotFoundErrorat construction.Adds a
pytest_collection_modifyitemshook intest_autoarray/conftest.pythat, only whennufftaxis unavailable, skips exactly the default-nufftax interferometer/transformer tests — keeping the explicitDFTandpynuffttransformer tests running. On 3.12/3.13 (nufftax present) nothing is skipped.Test Plan (verified locally, Python 3.12.10)
test_transformer.py13 passed / 0 skipped; the 3 interferometer files 43 passed / 0 skipped — hook is inert.test_transformer.py→ 5 passed (2 DFT + 3 pynufft), 8 skipped (the__nufft__tests); interferometer files → 43 skipped cleanly, no failures/errors.Pairing
Lands with PyAutoBuild
feature/matrix-nufftax-py312(addsPyAutoArray[optional]so nufftax/pynufft install on 3.12/3.13). Test-only change — no library source touched.🤖 Generated with Claude Code