Add perlin test coverage: params, degenerate shapes, metadata#3472
Merged
Conversation
Adds tests for previously uncovered paths in perlin(): - seed/freq/name parameter coverage (all prior tests used defaults) - 1xN single-row raster (works) - 1x1 and Nx1 single-column rasters: pins current all-NaN output caused by ptp divide-by-zero in the normalization step - dims + attrs preservation - input coords: pins current drop behavior Two source bugs surfaced (coords dropped; 1x1/Nx1 all-NaN). The degenerate-shape and coords tests pin current behavior and should be flipped once those are fixed. Test-only change; no source modified.
This was referenced Jun 24, 2026
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.
Test-coverage sweep for
xrspatial/perlin.py. Tests only, no source changes.All four backends were already covered with cross-backend equivalence. The gaps were in parameters, geometric edge cases, and metadata.
New tests:
seed/freq/nameparameters. Every existing test used the defaults, so these knobs had no coverage. The new tests check that different seeds and frequencies change the field, that the same seed reproduces it, and thatnamesets the output name.perlin()builds its output from dims and attrs but not coords, so coordinate variables are dropped. The test pins the current drop.Two real source bugs turned up while writing these (coords dropped; 1x1/Nx1 all-NaN). Per the sweep rules I did not fix source here. The two pinning tests carry comments saying to flip them once the bugs are fixed. Issues still need to be filed manually (issue creation was blocked in this run).
GPU tests, including the new param tests, ran on a CUDA host. Full file: 21 passed.