Update stale VRT window clamping tests to match #1697 reject contract#1723
Closed
brendancol wants to merge 1 commit into
Closed
Update stale VRT window clamping tests to match #1697 reject contract#1723brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
After #1697, read_vrt rejects out-of-bounds windows with ValueError instead of silently clamping. Two tests in test_kwarg_behaviour_2026_05_12_v2.py still asserted the old clamping behaviour and have been rewritten to lock in the reject contract, mirroring the local-path (#1634) and HTTP path (#1669) validators. Closes #1719
Contributor
There was a problem hiding this comment.
Pull request overview
Updates stale VRT window-behavior tests to reflect the post-#1697 contract where read_vrt(..., window=...) rejects any out-of-bounds window with ValueError (instead of silently clamping).
Changes:
- Renamed two window tests to reflect the new “reject” behavior.
- Replaced clamping assertions with
pytest.raises(ValueError, match="outside the VRT extent")for out-of-bounds windows (past-edge and negative offsets).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Superseded by #1731, which landed the same fix (different rename: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read_vrtrejects any window outside the VRT extent withValueError. Two tests intest_kwarg_behaviour_2026_05_12_v2.pystill asserted the pre-read_vrt: out-of-bounds window silently clamped instead of raising (drift from local/HTTP) #1697 clamping behaviour and were failing.test_window_clamps_to_raster_boundstotest_window_out_of_bounds_raisesandtest_window_clamps_negative_offsetstotest_window_negative_offsets_raise. Both now usepytest.raises(ValueError, match="outside the VRT extent"), matching the same contractread_to_array(open_geotiff eager path windowed read coord/data shape mismatch on out-of-bounds windows #1634) and_read_cog_http(HTTP eager COG read drops window and band, no PlanarConfiguration=2 handling #1669) already enforce.Test plan
pytest xrspatial/geotiff/tests/test_kwarg_behaviour_2026_05_12_v2.py(23 passed)pytest xrspatial/geotiff/tests/ -k vrt(194 passed)xrspatial/geotiff/tests/for clamping assertions; no other tests assert the old behaviour.Closes #1719