Skip to content

geotiff: cover categorical PAM sidecar round-trip on dask and GPU write paths#3519

Merged
brendancol merged 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-geotiff-2026-06-25
Jun 25, 2026
Merged

geotiff: cover categorical PAM sidecar round-trip on dask and GPU write paths#3519
brendancol merged 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-test-coverage-geotiff-2026-06-25

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3518.

The #3483 categorical PAM sidecar feature emits a <file>.aux.xml sidecar 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 + colors
  • test_gpu_write_round_trips_categories: GPU writer round-trips names + colors (requires_gpu)
  • test_round_trips_names_without_colors: covers the category_colors=None build branch and the names-only read path, which the existing suite never hits

Test-only, no source edits. The paths already work today; this locks them in. All three pass on a CUDA host.

…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.
@brendancol brendancol merged commit ef2e35d into xarray-contrib:main Jun 25, 2026
11 of 12 checks passed
@brendancol

Copy link
Copy Markdown
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.

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.

geotiff: categorical PAM sidecar round-trip tested only on the eager numpy write path

1 participant