Skip to content

test(templates): cover single-pixel/strip grids and resolution-tuple validation#3540

Merged
brendancol merged 2 commits into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-templates-2026-06-26
Jun 26, 2026
Merged

test(templates): cover single-pixel/strip grids and resolution-tuple validation#3540
brendancol merged 2 commits into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-templates-2026-06-26

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Adds test-only coverage for two untested paths in from_template, found by the test-coverage deep-sweep.

  • test_single_pixel_grid: a resolution coarser than the study area clamps to a 1x1 grid via max(1, ...); asserts shape, exact res, and all-NaN fill.
  • test_strip_grid: a huge resolution on one axis clamps that axis to 1, giving an Nx1/1xN strip.
  • test_resolution_tuple_wrong_length_raises: a tuple of length != 2 raises ValueError.

No source change. The behavior was already correct; these just close the coverage gaps. Ran locally on a CUDA host: 66 passed, 0 skipped.

…validation

Adds test-only coverage for two reachable from_template paths the
test-coverage sweep found untested:

- the max(1, ...) width/height floor (single-pixel and Nx1/1xN strip)
- the _normalize_resolution wrong-length tuple ValueError

No source change; behavior was already correct. Also records the
templates row in the test-coverage sweep state CSV.
@brendancol brendancol merged commit 1ef7769 into xarray-contrib:main Jun 26, 2026
10 checks passed
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