Test from_template tuple chunks and explicit-shape chunk-cap message#3580
Merged
Conversation
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.
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.
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
templatesfound the backend matrix, NaN/fill, geometric edge cases, and metadata already covered. These were the two remaining holes in parameter coverage offrom_template.What's added
test_chunks_tuple_through_public_api:chunksaccepts a(chunk_y, chunk_x)tuple, which the docstring lists, but only theintand'auto'forms went throughfrom_templateend to end. The tuple form was checked only against the internal_estimate_n_chunkshelper. 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 explicitheight/widthpath, but only the resolution-path message had a test. On the height/width path the message has to nameheight/width(the knob the caller actually set), not the derived resolution. Passingchunks=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.pyon a CUDA host: 281 passed, including the two new tests with GPU paths run, not skipped.