diff --git a/test_autoarray/inversion/pixelization/interpolator/test_knn_barycentric.py b/test_autoarray/inversion/pixelization/interpolator/test_knn_barycentric.py index 39c9632f..74829650 100644 --- a/test_autoarray/inversion/pixelization/interpolator/test_knn_barycentric.py +++ b/test_autoarray/inversion/pixelization/interpolator/test_knn_barycentric.py @@ -1,3 +1,5 @@ +import importlib.util + import numpy as np import pytest @@ -5,6 +7,14 @@ barycentric_weights_from_3_nearest, ) +# The kNN weight computation is jax-backed; these tests need jax installed to +# run (it ships via the `[optional]` extras). The NumPy-only Python-version +# matrix has no jax, so skip there rather than fail. +requires_jax = pytest.mark.skipif( + importlib.util.find_spec("jax") is None, + reason="requires jax (installed via the [optional] extras; absent on the NumPy-only matrix env)", +) + def test__weights__interior_query_matches_delaunay_exactly(): mesh = np.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]) @@ -129,6 +139,7 @@ def test__mesh_class__inherits_knn_knobs(): assert mesh.split_neighbor_division == 2 +@requires_jax def test__interpolator__numpy_path_returns_writable_mappings_and_weights(): """ Regression guard: on the numpy path, `mappings` and `weights` must be