Skip to content

Add perlin test coverage: params, degenerate shapes, metadata#3472

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-perlin-2026-06-23
Jun 23, 2026
Merged

Add perlin test coverage: params, degenerate shapes, metadata#3472
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-perlin-2026-06-23

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

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/name parameters. 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 that name sets the output name.
  • 1xN single-row raster, which works because the x axis still varies.
  • 1x1 and Nx1 single-column rasters. These currently come back all-NaN: the noise is constant down a single column, so the ptp normalization divides by zero. The test pins that behavior with a comment pointing at the bug.
  • dims and attrs preservation.
  • input coords. 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.

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.
@brendancol brendancol merged commit 4c6cfd7 into main Jun 23, 2026
12 checks passed
@brendancol brendancol deleted the deep-sweep-test-coverage-perlin-2026-06-23 branch June 25, 2026 14:55
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