geotiff: cross-library accuracy test (rasterio vs xrspatial vs zarr) (#1961)#1963
Conversation
PR Review: geotiff: cross-library accuracy test (rasterio vs xrspatial vs zarr) (#1961)Blockers (must fix before merge)
Suggestions (should fix, not blocking)
Nits (optional improvements)
What looks good
Cross-library parity notesThe test reads each fixture with Checklist
|
…skip exc_type) Renames TestMultibandUint16PerBandNodata to TestMultibandUint16SharedNodata since GDAL_NODATA is a single dataset-level tag and rasterio's GTiff path collapses per-band writes to one value. Adds a docstring explaining the format limitation. Passes exc_type=ImportError to the rasterio and zarr importorskip calls so pytest 9.1 does not raise PytestDeprecationWarning when the package imports but a native extension is missing.
|
Addressed the review in 0da084c:
All 8 tests pass locally. |
|
Rebased onto main at |
…skip exc_type) Renames TestMultibandUint16PerBandNodata to TestMultibandUint16SharedNodata since GDAL_NODATA is a single dataset-level tag and rasterio's GTiff path collapses per-band writes to one value. Adds a docstring explaining the format limitation. Passes exc_type=ImportError to the rasterio and zarr importorskip calls so pytest 9.1 does not raise PytestDeprecationWarning when the package imports but a native extension is missing.
…1961) Reads the same TIFF three ways (rasterio, open_geotiff, to_zarr/open_zarr) and asserts they agree on pixels, coords, CRS, transform, and nodata. Covers cases that have drifted before: float32 with non-NaN nodata, multi-band uint16 with per-band nodata, north-up vs south-up, 1xN/Nx1 stripes (#1945), tiled no-overview, and no-georef integer coords (#1949). rasterio and zarr are gated with importorskip.
…skip exc_type) Renames TestMultibandUint16PerBandNodata to TestMultibandUint16SharedNodata since GDAL_NODATA is a single dataset-level tag and rasterio's GTiff path collapses per-band writes to one value. Adds a docstring explaining the format limitation. Passes exc_type=ImportError to the rasterio and zarr importorskip calls so pytest 9.1 does not raise PytestDeprecationWarning when the package imports but a native extension is missing.
Closes #1961.
Adds xrspatial/geotiff/tests/test_round_trip_parity_rasterio_zarr_1961.py.
Reads the same TIFF with rasterio, open_geotiff, and a to_zarr/open_zarr
round trip, and asserts pixel values, shape, dtype, nodata sentinel, x/y
coords, CRS (normalised through _resolve_crs_to_wkt), and the affine
transform agree.
Cases:
rasterio and zarr go through pytest.importorskip so the CPU-only matrix
without those deps stays green.
Test plan