You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
geotiff: VRT tests assert window clamping but read_vrt now rejects out-of-bounds windows #1719
After #1697, read_vrt rejects any window outside the VRT extent with a ValueError (xrspatial/geotiff/_vrt.py:489-504). This matches the local-file path (read_to_array, #1634) and the HTTP path (_read_cog_http, #1669), so the cross-backend contract is consistent.
The test suite did not get updated to match. xrspatial/geotiff/tests/test_kwarg_behaviour_2026_05_12_v2.py:463 (test_window_clamps_to_raster_bounds) and :480 (test_window_clamps_negative_offsets) still assert clamping behavior. These tests should either be failing in CI or have been quietly skipped.
Expected behavior
The reject-out-of-bounds contract from #1697 is the canonical one and matches the other backends. The two clamping tests should be replaced with pytest.raises(ValueError) tests that lock in the new contract.
Proposed fix
Delete or rewrite test_window_clamps_to_raster_bounds and test_window_clamps_negative_offsets to assert ValueError instead.
Confirm CI passes locally to make sure no other tests carry the old assumption.
Already fixed on main by #1731 (merged 2026-05-12). Both test_window_clamps_to_raster_bounds and test_window_clamps_negative_offsets were renamed to test_window_outside_raster_bounds_rejected / test_window_negative_offsets_rejected and now assert pytest.raises(ValueError, match="outside the VRT extent"). PR #1723 (this branch's earlier attempt with different rename) was superseded and closed.
Activity
brendancol commentedon May 14, 2026
Already fixed on main by #1731 (merged 2026-05-12). Both
test_window_clamps_to_raster_boundsandtest_window_clamps_negative_offsetswere renamed totest_window_outside_raster_bounds_rejected/test_window_negative_offsets_rejectedand now assertpytest.raises(ValueError, match="outside the VRT extent"). PR #1723 (this branch's earlier attempt with different rename) was superseded and closed.