Test mahalanobis Inf input, all-NaN, and degenerate shapes (#3583)#3584
Open
brendancol wants to merge 1 commit into
Open
Test mahalanobis Inf input, all-NaN, and degenerate shapes (#3583)#3584brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
…ntrib#3583) mahalanobis() had complete backend and NaN coverage but left a few paths untested. Each behaves correctly on a CUDA host, so these are coverage gaps rather than bugs: - Inf/-Inf in any band -> NaN output and excluded from auto stats, verified identical across all four backends - the 'Not enough valid pixels' branch for all-NaN and too-few-valid inputs - 1x1 single-pixel (provided stats work, auto stats raise) and 1xN/Nx1 strips Test-only. 34 tests pass with no skips on a GPU 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 #3583.
mahalanobis()already covers all four backends and NaN propagation. This adds tests for three paths that ran without any coverage. I probed each on a CUDA host first, so they all behave correctly today; this is regression-guarding, not a bug fix.test_inf_*): a non-finite cell in any band becomes NaN in the output and is dropped from the auto-computed statistics. Asserted identical across numpy, cupy, dask+numpy, and dask+cupy.test_error_all_nan_input,test_error_too_few_valid_pixels): all-NaN input and fewer thann_bands + 1finite cells both raiseValueError("Not enough valid pixels ...").test_single_pixel_*,test_strip_shapes_match_numpy_dask): 1x1 with provided stats returns the right distance, 1x1 with auto stats raises, and 1xN / Nx1 strips match between numpy and dask.Test-only, no source changes. 34 tests pass with 0 skips on a GPU host. The cupy and dask+cupy tests carry the existing
@cuda_and_cupy_availableguard.