Commit 88eb46b
fix: skip the JAX-only sparse-operator tests where jax is unavailable (#658)
unit_tests (3.9, PyAutoLens) and (3.10, PyAutoLens) have been red in
PyAutoHands/python_matrix with 5 failures, all:
ModuleNotFoundError: No module named 'jax'
.../inversion_interferometer_util.py:654: in from_nufft_precision_operator
import jax.numpy as jnp
reached via Interferometer.apply_sparse_operator (dataset.py:280). The whole
sparse-operator subsystem is JAX-only by design — InterferometerSparseOperator
builds its FFT kernel with jax.numpy and projects with jax.ops.segment_sum /
jax.lax, and the imaging counterpart even types a field as 'jax.Array'. There
is no NumPy equivalent, and autonerves[jax] gates jax to Python >= 3.11.
So these are JAX-feature tests sitting in matrix legs that have no jax: a test
placement problem, not a library bug. Marking exactly the 5 cases that call
apply_sparse_operator() with a find_spec-based skipif, matching the
pytest.importorskip idiom already used in test_autolens/interop/test_coolest.py.
This also restores the standing 'library unit tests are numpy-only' rule for
these files: the dense-route cases stay NumPy-only and keep running on 3.9/3.10,
which is exactly what those legs exist to prove.
Verified both ways:
jax present -> 9 passed, 0 skipped
jax absent -> 4 passed, 5 skipped (the 5 CI failures, and only those)
Co-authored-by: Jammy2211 <JNightingale2211@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 56dfacf commit 88eb46b
2 files changed
Lines changed: 31 additions & 0 deletions
File tree
- test_autolens/potential_correction
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
10 | 23 | | |
11 | 24 | | |
12 | 25 | | |
| |||
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| 66 | + | |
53 | 67 | | |
54 | 68 | | |
55 | 69 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
7 | 20 | | |
8 | 21 | | |
9 | 22 | | |
| |||
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
| 73 | + | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
| |||
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
| |||
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
| |||
0 commit comments