geotiff: cover degenerate-shape reads on dask and GPU backends#2973
Merged
brendancol merged 1 commit intoJun 5, 2026
Merged
Conversation
The eager numpy reader already covers 1x1 / 1xN / Nx1 sources, and the dask streaming write path covers writing degenerate dask rasters. The read side on the non-eager backends was untested: the windowed dask reader (chunks=) splitting a single-pixel dimension into chunks, the GPU reader (gpu=True) launching its decode kernels on a degenerate grid, and the dask+gpu combination. The smallest dask-read source in the existing suite is 8x8 / 2x32; the parity matrix fixtures are 32x32 / 64x64. These paths work today, so this is a coverage gap rather than a bug fix. Add read/test_degenerate_shapes.py: dask read across chunk sizes that meet, split, and exceed the degenerate dimension; coord / transform / CRS parity; GPU read and dask+gpu read. Each cell asserts pixel parity against the eager numpy read. The fixture supplies an explicit attrs['transform'] because the writer cannot infer a pixel size from a single-element coord axis. Test-only; no source changes.
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
The eager numpy reader already covers degenerate-shape sources (1x1, 1xN, Nx1), and the dask streaming write path covers writing degenerate dask rasters. What was missing is the read side on the non-eager backends:
chunks=) splitting a single-pixel dimension into chunks,gpu=True) launching its decode kernels on a degenerate grid,dask+gpucombination.The smallest dask-read source in the existing suite is 8x8 / 2x32, and the parity-matrix fixtures are 32x32 / 64x64, so these shapes never reached the windowed read or the GPU launch.
I probed all three backends on these shapes first. They read correctly today, so this is a coverage gap rather than a bug, and no source code changes.
What was added
xrspatial/geotiff/tests/read/test_degenerate_shapes.py, 18 tests:The fixture passes an explicit
attrs['transform']because the writer cannot infer a pixel size from a single-element coord axis.Validation
All 18 tests pass on a CUDA host. The 6 GPU and dask+gpu cells ran rather than skipped, and the 1x1 GPU read goes through a grid-size-1 kernel launch. flake8 clean.
Found by the test-coverage deep-sweep against the geotiff module.