Test coverage: morphology edge inputs (Inf, all-NaN, strip, integer)#3415
Open
brendancol wants to merge 3 commits into
Open
Test coverage: morphology edge inputs (Inf, all-NaN, strip, integer)#3415brendancol wants to merge 3 commits into
brendancol wants to merge 3 commits into
Conversation
Test-only. Covers four edge inputs that the source already handles correctly but no test exercised: - Inf / -Inf flow through the min/max kernel and the NaN branch - all-NaN raster stays NaN across all four ops - Nx1 / 1xN strip rasters keep shape on the map_overlap path - integer dtype input is accepted and promoted to float64 numpy plus dask / cupy parity where applicable.
brendancol
commented
Jun 20, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: morphology edge-input coverage (Inf, all-NaN, strip, integer)
Test-only PR. No source files changed, so the correctness / backend / performance / docs categories are mostly N/A. I reviewed the four new test groups in test_morphology.py.
Blockers
None.
Suggestions
None blocking.
Nits
- The all-NaN, strip, and integer-dtype tests cover numpy and dask but not cupy. That is fine here: the GPU min/max kernel logic is identical and is already cross-checked by the broad erode/dilate cupy parity tests plus the new Inf cupy parity test. Adding cupy variants would be belt-and-suspenders, not a real gap.
What looks good
- Inf tests assert concrete min/max values and finite-vs-inf positions, not just "runs without error".
- Inf parity covered on numpy, dask, and cupy.
- Strip and integer tests are parametrized over both orientations and three integer dtypes.
- all-NaN uses boundary='nearest', so the assertion isolates the all-NaN input rather than edge padding.
- New tests pass alongside the existing 86-test suite.
Checklist
- Source unchanged, no algorithm to verify
- Backends consistent: parity asserted for Inf (numpy/dask/cupy), all-NaN and strip (numpy/dask)
- NaN handling correct
- Edge cases covered (the point of the PR)
- Dask boundaries: strip tests hit the degenerate-axis map_overlap path
- No premature materialization: .compute() only in assertions
- Benchmark not needed, test-only
- README matrix not needed, no new function
- Docstrings present on each test
…age-morphology-2026-06-20
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 #3404
Adds test-only coverage for four morphology edge inputs that the source already handles correctly but no test exercised. No source changes.
Backends: numpy plus dask, cupy, and dask+cupy parity where applicable, using the cross-backend helpers in general_checks.py. The cupy and dask+cupy variants ran on a GPU host before this PR.
Test plan