Skip to content

Commit 7f6b18b

Browse files
committed
Document XRSPATIAL_GEOTIFF_STRICT env var in geotiff reference (#1662)
1 parent 5b7f3bf commit 7f6b18b

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

docs/source/reference/geotiff.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,24 @@ Writing
2020
xrspatial.geotiff.to_geotiff
2121
xrspatial.geotiff.write_geotiff_gpu
2222
xrspatial.geotiff.write_vrt
23+
24+
Strict mode (``XRSPATIAL_GEOTIFF_STRICT``)
25+
==========================================
26+
27+
Several internal helpers historically returned ``None`` when something went
28+
wrong: pyproj failing to parse a WKT string, a VRT source file being
29+
missing, a GPU helper (GDS, nvCOMP, nvJPEG, nvJPEG2000) hitting a CUDA or
30+
library error. These now emit :class:`xrspatial.geotiff.GeoTIFFFallbackWarning`
31+
with the original exception type and message.
32+
33+
Set ``XRSPATIAL_GEOTIFF_STRICT=1`` (or ``true``, ``yes``) to promote those
34+
warnings into raised exceptions. The same env var also forces
35+
``read_geotiff_gpu(on_gpu_failure='auto')`` to behave like
36+
``on_gpu_failure='strict'`` so CI can fail loudly when the GPU fast path
37+
silently falls back to CPU.
38+
39+
.. code-block:: bash
40+
41+
XRSPATIAL_GEOTIFF_STRICT=1 pytest xrspatial/geotiff/tests/
42+
43+
See issue #1662 for the audit and the full list of affected call sites.

0 commit comments

Comments
 (0)