Test idea
Read the same GeoTIFF three ways and assert the results agree:
rasterio.open(path) → numpy array, transform, CRS, nodata.
xrspatial.geotiff.open_geotiff(path) → xr.DataArray.
- Write the xarray-spatial DataArray with
.to_zarr(...), reopen with xr.open_zarr(...).
Pairwise checks across the three readers:
- pixel values (
array_equal for integer dtypes, allclose with a documented tolerance for floats)
- shape, dtype, nodata sentinel
x and y coordinate arrays within float tolerance
- CRS WKT after normalising through
_resolve_crs_to_wkt
- affine transform (origin, pixel size) within
1e-9 relative
Why
The project already has backend-parity tests inside its own implementation (numpy / cupy / dask / dask+cupy). What's missing is a test that pins the GeoTIFF reader against an external reference (rasterio) and against a round-trip through a different on-disk format (Zarr). A regression in header parsing, georef extraction, coord generation, nodata handling, or Zarr metadata propagation can pass every existing test and only surface when a user files a bug.
Suggested inputs
Cover the cases that have drifted before:
Suggested location
xrspatial/geotiff/tests/test_round_trip_parity_rasterio_zarr_<issue#>.py
Gate the imports with pytest.importorskip("rasterio") and pytest.importorskip("zarr") so the CPU-only matrix without those deps stays green.
Out of scope
- performance comparison (handled by the bench skill)
- GPU read paths (covered by the existing backend parity tests)
- cloud / HTTP sources (local-file only)
Test idea
Read the same GeoTIFF three ways and assert the results agree:
rasterio.open(path)→ numpy array, transform, CRS, nodata.xrspatial.geotiff.open_geotiff(path)→xr.DataArray..to_zarr(...), reopen withxr.open_zarr(...).Pairwise checks across the three readers:
array_equalfor integer dtypes,allclosewith a documented tolerance for floats)xandycoordinate arrays within float tolerance_resolve_crs_to_wkt1e-9relativeWhy
The project already has backend-parity tests inside its own implementation (numpy / cupy / dask / dask+cupy). What's missing is a test that pins the GeoTIFF reader against an external reference (rasterio) and against a round-trip through a different on-disk format (Zarr). A regression in header parsing, georef extraction, coord generation, nodata handling, or Zarr metadata propagation can pass every existing test and only surface when a user files a bug.
Suggested inputs
Cover the cases that have drifted before:
pixel_height)Suggested location
xrspatial/geotiff/tests/test_round_trip_parity_rasterio_zarr_<issue#>.pyGate the imports with
pytest.importorskip("rasterio")andpytest.importorskip("zarr")so the CPU-only matrix without those deps stays green.Out of scope