Add GPU backend test coverage for idw()#2925
Merged
brendancol merged 2 commits intoJun 5, 2026
Merged
Conversation
brendancol
commented
Jun 4, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: Add GPU backend test coverage for idw()
Test-only change adding cupy and dask+cupy coverage for idw(). I confirmed all 6 new tests run (not skipped) and pass on a CUDA host, and that a cupy template routes through _idw_cupy (the result comes back cupy-backed).
Blockers
None.
Suggestions
None.
Nits
None.
What looks good
- The new tests follow the existing kriging GPU coverage in the same file and reuse the
_to_numpyhelper and the@cuda_and_cupy_available/@dask_array_availabledecorators. - Both the equivalence path and the k-nearest rejection path of the GPU wrappers are now covered.
test_dask_cupy_knearest_rejectedraises eagerly at graph construction, so it does not call.compute().- Source is untouched, which matches the test-coverage sweep contract.
Checklist
- All implemented backends produce consistent results (cupy / dask+cupy now asserted equal to numpy)
- Edge cases covered (exact-match interpolation on GPU; GPU k rejection)
- Dask chunk boundaries handled (2x2 chunks, all-points path)
- No premature materialization
- No README / docstring changes needed (test-only)
Add cupy and dask+cupy tests to TestIDW: all-points equivalence vs numpy, cupy exact-interpolation, and the GPU k-nearest rejection paths. Closes the backend-coverage gap where _idw_cupy / _idw_dask_cupy were registered in the dispatch table but never exercised by any test.
1b06a5f to
6065316
Compare
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.
Closes #2919
idw()registers four backends (numpy, cupy, dask+numpy, dask+cupy) but the test suite only exercised numpy and dask+numpy. The cupy and dask+cupy paths were never run by any test, unlike kriging in the same file which already has GPU coverage. This adds the missing tests so a GPU-only regression in_idw_cuda_kernelor the cupy/dask+cupy wrappers gets caught.Test-only change. No source files were modified.
New tests in
TestIDW:test_cupy_matches_numpy,test_cupy_exact_interpolationtest_dask_cupy_matches_numpytest_cupy_knearest_rejected,test_dask_cupy_knearest_rejectedBackend coverage: numpy and dask+numpy were already covered; this PR adds cupy and dask+cupy.
Test plan:
pytest xrspatial/tests/test_interpolation.py-> 46 passed on a CUDA host