test(convolution): backend, boundary, and metadata coverage#3621
Open
brendancol wants to merge 1 commit into
Open
test(convolution): backend, boundary, and metadata coverage#3621brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
Deep-sweep test-coverage on a CUDA host. Branch coverage was 52% with the test file exercising only numpy error paths and the default boundary mode. convolve_2d/convolution_2d dispatch to numpy, cupy, dask+numpy, and dask+cupy, but only the numpy path had tests. Add: - Backend parity: convolution_2d numpy vs dask+numpy, cupy, dask+cupy (Cat 1). Ran and passed on the GPU host. - Boundary modes: nan/nearest/reflect/wrap on numpy+dask and a cupy/dask+cupy-vs-numpy loop; invalid-boundary ValueError (Cat 4). - Metadata: convolution_2d preserves coords/dims/attrs/name (Cat 5). - NaN-interior propagation (Cat 2); degenerate 1x1/1xN/Nx1 all-NaN (Cat 3). - Previously untested public funcs: calc_cellsize, annulus_kernel, custom_kernel valid/non-ndarray/even-dims, circle_kernel bad radius/unit. Full file: 26 passed including 3 GPU tests. No source change; no bug surfaced. flake8/isort clean.
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.
What
Adds tests for
xrspatial/convolution.py. Before this, the test file had 5 teststhat only touched numpy error paths and the default boundary mode, so branch
coverage sat at 52%.
convolve_2dandconvolution_2ddispatch across numpy, cupy, dask+numpy, anddask+cupy, but only the numpy path was exercised. The boundary parameter has four
public modes and only the default was tested.
convolution_2dre-attachescoords/dims/attrs/name and nothing checked that it does.
New tests
convolution_2dnumpy vs dask+numpy, cupy, and dask+cupy.vs numpy comparison over all four modes. Plus the invalid-boundary ValueError.
convolution_2dpreserves coords, dims, attrs, and name; custom name.calc_cellsize(res attr and km->m unitconversion),
annulus_kernel,custom_kernelvalid/non-ndarray/even-dims, andcircle_kernelbad radius/unit.Verification
Ran on a CUDA host, so the cupy and dask+cupy tests executed for real, not just
static review. Full file: 26 passed, including the 3 GPU tests. flake8 and isort
clean.
No source change. No bug surfaced by the new tests. This is test-only.
Branch coverage went from 52% to 72% as measured on CPU (
NUMBA_DISABLE_JIT=1).The cupy kernel lines can't be seen by CPU coverage instrumentation, but they run
under the 3 passing GPU tests.
Found by the test-coverage deep sweep.