Commit 46f567f
authored
* Test write_geotiff_gpu compression modes (#1646)
Cover the documented compression= modes that had no targeted
round-trip tests:
- zstd (the default, "fastest on GPU"): pixel-exact round-trip on
int32 plus default-codec pinning via TIFF tag 259.
- jpeg (nvJPEG with Pillow fallback): round-trip for 3-band uint8 RGB
and single-band uint8 with mean-abs-diff bounds; pin compression
tag 7. Exercises the live nvJPEG encoder on a GPU host, not just
the Pillow fallback.
- deflate + none: plain round-trips outside the COG / nodata-sentinel
paths so a regression in the basic tiled assembly is visible.
- Cross-codec parity: zstd, deflate, none must produce pixel-identical
read-backs for the same input (catches predictor / codec mis-wiring).
11 tests, all passing on the GPU host.
Update .claude/sweep-test-coverage-state.csv to record pass 7.
* Address Copilot review feedback on #1647
- Rewrite test_write_geotiff_gpu_zstd_default_matches_explicit so the
docstring matches what it asserts: pin the compression tag and the
decoded-array equality, not byte-for-byte file equality (the writer
may legitimately vary tile padding/ordering between runs).
- Swap the JPEG RGB test input from random uint8 noise to a deterministic
smooth gradient (mirroring test_jpeg.py::_gradient_rgb). Tighten the
mean-abs-diff bound from 50 to 8 for RGB and to 5 for the monochrome
variant; the looser bound only existed because random noise is the
worst case for JPEG.
- Add test_write_geotiff_gpu_jpeg_uses_nvjpeg_when_available: spy on
_gpu_decode._nvjpeg_batch_encode via monkeypatch and assert it fires
at least once when libnvjpeg is loadable. Without this spy a
regression breaking nvJPEG would silently fall through to the Pillow
fallback and the round-trip tests would still pass. The new test is
guarded by _nvjpeg_only so it only runs on hosts where libnvjpeg is
actually loadable.
1 parent 2ca76db commit 46f567f
2 files changed
Lines changed: 397 additions & 1 deletion
File tree
- .claude
- xrspatial/geotiff/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
0 commit comments