test(proximity): cover degenerate shapes, non-default metrics, attrs#2712
Open
brendancol wants to merge 1 commit into
Open
test(proximity): cover degenerate shapes, non-default metrics, attrs#2712brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
…array-contrib#2692) Adds 65 tests to test_proximity.py. Test-only; no source changes. - Cat 3: 1x1 / Nx1 / 1xN degenerate rasters for proximity, allocation, and direction on numpy, cupy, dask+numpy, dask+cupy. - Cat 1/4: MANHATTAN and GREAT_CIRCLE on allocation and direction across all four backends (previously only proximity tested non-default metrics cross-backend). - Cat 5: attrs preservation with non-empty res/crs, plus a bounded-dask test exercising the res-attr-driven padding path. All new tests run and pass on a CUDA host.
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 #2692. Test-only; no source changes.
Adds 65 tests to
test_proximity.py. All run and pass on a CUDA host across numpy, cupy, dask+numpy, and dask+cupy. None of these pins a bug; the current behavior is correct everywhere. They lock the behavior so a regression shows up in CI.What's covered:
proximity,allocation, anddirectionon all four backends. These shapes are where the line-sweep kernel boundaries (_process_proximity_line) and the GPU brute-force kernel grid sizing (_proximity_cuda_kernel) tend to break. Expected values are hand-checked; a mutation of one pinneddirectionexpectation confirms the tests have teeth.MANHATTANandGREAT_CIRCLEonallocationanddirectionacross all four backends. Before this, onlyproximityexercised non-default metrics cross-backend. Both metrics match the numpy baseline.res/crsattrs (the sharedtest_rasterfixture carries no attrs, so the existing attrs check compares two empty dicts). Includes a bounded-dask test that exercises theres-attr-driven padding path, sinceproximityreadsattrs['res']viaget_dataarray_resolutionto sizemap_overlapdepth.Full
test_proximity.pysuite: 134 passed (was 69).Note for a future accuracy pass: a
resattr that disagrees with the actual coordinate spacing mis-sizes the bounded-daskmap_overlapdepth (raises or produces wrong boundary results). That's a source fragility, out of scope for this test-only PR.