Commit 181056e
authored
* Sync write_geotiff_gpu compression docstring against the actual codec set (#1644)
The api-consistency sweep on 2026-05-11 flagged that
write_geotiff_gpu.__doc__ listed only four codecs ('zstd', 'deflate',
'jpeg', 'none') while the implementation accepts every codec to_geotiff
does. Codecs without an nvCOMP encoder fall through to the CPU encoders
(lzw, packbits, lz4, lerc, jpeg2000 / j2k) so the output matches the
CPU writer byte-for-byte.
Mirror to_geotiff's wording in the compression block and note which
codecs run on GPU vs. CPU fallback so users understand the performance
trade-off without surprise.
Regression test test_compression_docstring_1644.py pins the codec list
and round-trips each CPU-fallback codec end-to-end on a GPU host.
Doc-only change. No signature change, no deprecation impact.
* Address Copilot review feedback on #1649
Four wording fixes; no behavioural change:
- compression='jpeg': the docstring previously implied parity with
to_geotiff, but to_geotiff rejects jpeg at runtime (it omits the
JPEGTables tag and produces files that don't round-trip through GDAL).
Spell out that write_geotiff_gpu DOES accept jpeg, that the on-disk
bytes are self-contained JFIF tiles, and that GDAL/rasterio interop is
not guaranteed until the JPEGTables fix lands.
- compression='jpeg2000' / 'j2k': replace "route to the CPU encoders"
with the actual conditional behaviour (nvJPEG2K GPU encode first, CPU
glymur fallback when libnvjpeg2k is missing) and call out that the two
paths are not byte-stable, so byte-for-byte parity with to_geotiff
isn't a contract here.
- test module docstring: distinguish "not nvCOMP-accelerated" (lzw,
packbits, lz4, lerc — truly CPU-only) from jpeg2000/j2k (GPU first
with CPU fallback) and from jpeg (write_geotiff_gpu only, separate
test module).
- "exercised by test_features.py" referenced a file that doesn't cover
JPEG. Repoint the test docstring to
test_gpu_writer_compression_modes_2026_05_11.py which actually pins
JPEG round-trips for the GPU writer.
All 7 tests in test_compression_docstring_1644.py still pass.
* Tighten compression-codec docstring for cleaner Sphinx rendering
The earlier paragraphs had a multi-line ``literal`` and unbalanced
parens nested inside it, which RST handles awkwardly and which may have
been contributing to slow/timing-out Sphinx builds on RTD. Convert the
per-codec block to a bullet list with no multi-line inline literals.
Same content, no behavioural change.
All 7 docstring tests still pass.
1 parent 6f4b2d1 commit 181056e
3 files changed
Lines changed: 163 additions & 3 deletions
File tree
- .claude
- xrspatial/geotiff
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2754 | 2754 | | |
2755 | 2755 | | |
2756 | 2756 | | |
2757 | | - | |
2758 | | - | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
2759 | 2786 | | |
2760 | 2787 | | |
2761 | 2788 | | |
| |||
Lines changed: 133 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments