Cover cupy median/mode, dask+cupy, integer input, target_resolution tuple in resample tests#1473
Merged
brendancol merged 1 commit intomainfrom May 4, 2026
Merged
Cover cupy median/mode, dask+cupy, integer input, target_resolution tuple in resample tests#1473brendancol merged 1 commit intomainfrom
brendancol merged 1 commit intomainfrom
Conversation
…uple in resample tests (#1470) Adds 41 tests to fill four gaps the resample audit found. No source changes.
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 #1470.
The recent resample audit flagged four corners of the test matrix that were never exercised. None of these are bug fixes — every path already worked, we just weren't testing it.
What's covered now
medianandmode.TestCuPyParity::test_aggregate_paritynow runs all five aggregate methods._run_cupyfalls back to CPU formedian/mode, but the cupy-in / cupy-out round-trip gets verified.TestDaskCuPyParityclass). MirrorsTestDaskParity: 3 interp methods × 3 scale factors plus 3 aggregate methods. Skips entirely when CUDA or dask is missing.TestIntegerInput). An int32 8×8 raster goes throughnearestand all five aggregate methods on numpy, cupy, dask+numpy, dask+cupy. Output is float, finite, and within the input range — no clipping, no overflow. Backends that aren't installed are skipped per-param.target_resolutiontuple (TestTargetResolutionTuple). A tuple of(2.0, 4.0)on an 8×8 raster with res=(1.0, 1.0) gives shape (4, 2) andattrs['res'] == (4.0, 2.0). Also asserts that the scalar form equals(s, s)and that the list form equals the tuple form.Local results
cuda_and_cupy_availabledecoratorTest plan
pytest xrspatial/tests/test_resample.pypasses locally