geotiff: cover categorical PAM sidecar round-trip on dask and GPU write paths#3519
Merged
brendancol merged 1 commit intoJun 25, 2026
Conversation
…te paths (xarray-contrib#3518) The xarray-contrib#3483 categorical PAM sidecar feature is round-trip tested only on the eager numpy write path. The dask streaming and GPU (nvCOMP) writers each emit the sidecar via their own _write_category_sidecar() call, but no test exercised those branches, so a refactor dropping one would lose category labels silently. Add geotiff/tests/write/test_category_sidecar_backends_3483.py: dask and GPU write round-trips of names + colors, plus a names-only round-trip covering the category_colors=None build branch. Test-only; all three pass on a CUDA host.
Contributor
Author
|
review-pr: approve with one suggestion, now applied. The new tests reach the branches they claim. The dask test hits the streaming writer + sidecar emit at _writers/eager.py:1063 (not the eager-compute fallback at 1159), and the GPU test reaches _write_geotiff_gpu + sidecar emit at line 880. The names-only test covers the category_colors=None build path. Applied: the tests asserted sidecar metadata but not the pixel codes, so a corrupted int32 band would have passed. Added assert_array_equal(back.values, _CODES) to all three. 3/3 pass on the CUDA host, including the requires_gpu GPU-write test. |
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.
Closes #3518.
The #3483 categorical PAM sidecar feature emits a
<file>.aux.xmlsidecar on the eager numpy, dask streaming, and GPU (nvCOMP) write paths, but only the eager numpy round-trip was tested. The dask and GPU branches each have their own_write_category_sidecar()call, so dropping the emit on one of them in a refactor would lose category labels with no failing test.New file
xrspatial/geotiff/tests/write/test_category_sidecar_backends_3483.py:test_dask_write_round_trips_categories: dask streaming writer emits and round-trips names + colorstest_gpu_write_round_trips_categories: GPU writer round-trips names + colors (requires_gpu)test_round_trips_names_without_colors: covers thecategory_colors=Nonebuild branch and the names-only read path, which the existing suite never hitsTest-only, no source edits. The paths already work today; this locks them in. All three pass on a CUDA host.