Skip to content

corridor: add strip, cross-backend, param, and metadata coverage#3448

Open
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-corridor-2026-06-22
Open

corridor: add strip, cross-backend, param, and metadata coverage#3448
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-corridor-2026-06-22

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

least_cost_corridor hands its backend math to cost_distance and otherwise does plain xarray arithmetic, so the existing suite already covered the four backends on the core paths. These tests close the gaps a deep-sweep audit found. Every path was probed first and already works, so this adds coverage rather than fixing bugs.

Added (test-only):

  • Nx1 and 1xN strip rasters (degenerate kernel-boundary shapes)
  • numpy vs dask+numpy / cupy / dask+cupy equivalence check
  • connectivity=4 and a finite max_cost, both forwarded to cost_distance
  • attrs and coords preservation, plus custom lat/lon dim-name propagation

41 tests pass on a CUDA host. The cupy and dask+cupy cases ran on the GPU instead of being skipped.

least_cost_corridor hands its backend math to cost_distance and otherwise
does plain xarray arithmetic, so the existing suite already covered the four
backends on the core paths. These tests close the gaps a deep-sweep audit
found. Every path was probed first and already works, so this adds coverage
rather than fixing bugs.

Added (test-only):
- Nx1 and 1xN strip rasters (degenerate kernel-boundary shapes)
- numpy vs dask+numpy / cupy / dask+cupy equivalence check
- connectivity=4 and a finite max_cost, both forwarded to cost_distance
- attrs and coords preservation, plus custom lat/lon dim-name propagation

41 tests pass on a CUDA host. The cupy and dask+cupy cases ran on the GPU
instead of being skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant