Skip to content

Test from_template tuple chunks and explicit-shape chunk-cap message#3580

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-test-coverage-templates-2026-06-30
Jul 1, 2026
Merged

Test from_template tuple chunks and explicit-shape chunk-cap message#3580
brendancol merged 2 commits into
mainfrom
deep-sweep-test-coverage-templates-2026-06-30

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Summary

Two test-coverage additions for from_template. Both cover behavior that already works; the point is to catch a future regression. No source change.

A deep-sweep test-coverage pass over templates found the backend matrix, NaN/fill, geometric edge cases, and metadata already covered. These were the two remaining holes in parameter coverage of from_template.

What's added

  • test_chunks_tuple_through_public_api: chunks accepts a (chunk_y, chunk_x) tuple, which the docstring lists, but only the int and 'auto' forms went through from_template end to end. The tuple form was checked only against the internal _estimate_n_chunks helper. The test asserts the tuple is honored verbatim and the resolution stays exact.
  • test_explicit_shape_chunk_count_message_names_height_width: the dask chunk-count guard fires on both the resolution path and the explicit height/width path, but only the resolution-path message had a test. On the height/width path the message has to name height/width (the knob the caller actually set), not the derived resolution. Passing chunks= promotes the eager default to dask and skips the cell cap, so the test lands on the chunk-count branch rather than the cell-cap branch.

Testing

Full test_templates.py on a CUDA host: 281 passed, including the two new tests with GPU paths run, not skipped.

Add two test-coverage tests for already-correct from_template behavior:

- chunks passed as a (chunk_y, chunk_x) tuple through the public API. The
  tuple form is documented but was only checked against the internal
  _estimate_n_chunks helper, never end-to-end. Assert it is honored
  verbatim and the resolution stays exact.
- the dask chunk-count guard on the height/width path. Its message must
  name height/width (the knob the caller set), not the derived
  resolution. Only the resolution-path chunk-count message and the eager
  cell-cap message were covered before.

Test-only; no source change.
@brendancol brendancol merged commit 932f81a into main Jul 1, 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