Publish the VRT support contract (#2327)#2334
Merged
Merged
Conversation
Docs-only. The previous docs implied general-purpose VRT reads. They
weren't, and the gap left readers guessing about which VRTs are
expected to work. Lock down the supported subset in one place and
echo it in the three public entry points.
- docs/source/reference/geotiff.rst: new "VRT support matrix"
section that calls out the supported subset (simple GDAL VRT
mosaics over GeoTIFF sources; compatible CRS, transform
orientation, pixel size, dtype, band count; windowed and dask
reads over the same subset; explicit nodata with mixed-band
rejection by default; missing_sources='raise' as the default)
and the explicit non-goals (warped VRTs, arbitrary resampling,
mixed metadata without an opt-in, nested VRTs, complex /
mask / alpha bands, full GDAL parity), plus one safe-usage
example and one intentionally-raises example.
- xrspatial/geotiff/__init__.py: open_geotiff's docstring echoes
the same subset / non-goals summary and carries the two
examples.
- xrspatial/geotiff/_backends/vrt.py: read_vrt's docstring echoes
the same summary and carries the two examples.
- xrspatial/geotiff/_writers/vrt.py: write_vrt's docstring echoes
the same summary and carries the two examples (noting the
failure mode lives on the read side).
VRT was already at the 'advanced' tier in SUPPORTED_FEATURES
('reader.vrt'); no change there. Tier text in each docstring is
unchanged.
Closes #2327. Parent: #2321.
brendancol
commented
May 23, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: Publish the VRT support contract (#2334)
Blockers (must fix before merge)
None.
Suggestions (should fix, not blocking)
-
xrspatial/geotiff/_backends/vrt.py:169-191: the new Examples block sits before the Parameters / Returns / Notes sections. numpydoc puts Examples after those sections, and that's the order you used inopen_geotiffandwrite_vrtin this same PR (xrspatial/geotiff/__init__.py:536,xrspatial/geotiff/_writers/vrt.py:95). Sphinx will render either order, but the three sibling docstrings disagreeing on section order is the bit worth fixing. Move the Examples block to sit below Notes so all three agree.
Nits (optional improvements)
-
docs/source/reference/geotiff.rst:241-242: the "Intentionally raises" snippet importsopen_geotiffandMixedBandMetadataErroron two separatefrom xrspatial.geotiff import ...lines. One combined import line is a touch tighter. -
xrspatial/geotiff/_writers/vrt.py:101-103: the safe-usage example usessource_files=['tile_west.tif', 'tile_east.tif']. The# doctest: +SKIPkeeps doctest from running the example against absent files, so it's fine. A one-line comment saying the paths are illustrative would help on first read.
What looks good
- Docs-only, narrowly scoped, four touched files agree on the contract text.
- VRT tier text in
read_vrt/write_vrtis unchanged; both still sayTier: Advanced (issue #2137).SUPPORTED_FEATURES['reader.vrt']was already'advanced', so the "mark as advanced wherever tiers are described" acceptance is met without rewording the tier label. - The example imports resolve.
xrspatial.geotiff.MixedBandMetadataErroris exported via__init__.py__all__(verified locally). - All doctest blocks carry
# doctest: +SKIP, so a future pytest doctest run will not try to execute them against absent files. - Existing VRT tests (665 passed, 27 skipped) and the docstring / signature parity gates (
test_signature_parity_1631.py,test_to_geotiff_bigtiff_doc_1683.py) still pass.
Checklist
- Algorithm correctness (N/A; docs only)
- Backend parity (N/A; no code paths touched)
- NaN handling (N/A)
- Edge-case tests (N/A; docs only)
- Dask chunk boundaries (N/A)
- No premature materialization or unnecessary copies (N/A)
- Benchmark (not needed; docs only)
- README feature matrix updated (skipped per rockout brief; no backend coverage change)
- Docstrings present and accurate (the point of the PR)
Follow-up to PR #2334 review: - xrspatial/geotiff/_backends/vrt.py: move the Examples block from before the Parameters section to after the Notes section so read_vrt's docstring matches the section order in open_geotiff and write_vrt (Suggestion). - docs/source/reference/geotiff.rst: collapse the two ``from xrspatial.geotiff import ...`` lines in the "Intentionally raises" snippet into one combined import (Nit). - xrspatial/geotiff/_writers/vrt.py: note that the example source_files paths are illustrative (Nit). No code paths touched. Existing VRT tests still pass (665 passed, 27 skipped).
brendancol
commented
May 23, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review (post-suggestion fixes)
Re-checked the PR after 7c34495b:
- Suggestion (numpydoc section order on
read_vrt): fixed. Examples block now sits below Notes;read_vrt/open_geotiff/write_vrtagree on order. - Nit (combined import in the "Intentionally raises" RST snippet): fixed.
- Nit (illustrative-paths note on
write_vrtexample): fixed.
No new findings. Existing VRT tests (665 passed, 27 skipped) and the docstring / signature parity gates (test_signature_parity_1631.py, test_to_geotiff_bigtiff_doc_1683.py) still pass.
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.
Closes #2327. Parent: #2321 (GeoTIFF release hardening, sub-PR 1 of 6).
Summary
Docs-only. Lock down the supported VRT subset so readers can tell which VRTs the reader expects to handle and which it is allowed to reject.
docs/source/reference/geotiff.rst: new "VRT support matrix" section. Calls out the supported subset (simple GDAL VRT mosaics over GeoTIFF sources; compatible CRS, transform orientation, pixel size, dtype, and band count; windowed and dask reads over the same subset; explicit nodata with mixed-band rejection by default;missing_sources='raise'as the default), the explicit non-goals (warped VRTs, arbitrary resampling, mixed metadata without an opt-in, nested VRTs, complex / mask / alpha bands, full GDAL parity), plus one safe-usage example and one intentionally-raises example.xrspatial/geotiff/__init__.py(open_geotifffor.vrtpaths),xrspatial/geotiff/_backends/vrt.py(read_vrt),xrspatial/geotiff/_writers/vrt.py(write_vrt): docstrings echo the same subset / non-goals summary and carry the two examples.VRT was already at the
advancedtier inSUPPORTED_FEATURES(reader.vrt); no change there.Backend coverage
No code paths touched. Existing VRT tests (eager numpy, dask, GPU where applicable) keep passing. Tier text in each docstring is unchanged.
Test plan
pytest xrspatial/geotiff/tests/ -k vrt— 665 passed, 27 skipped on local environment.pytest xrspatial/geotiff/tests/test_signature_parity_1631.py xrspatial/geotiff/tests/test_to_geotiff_bigtiff_doc_1683.py— 9 passed (docstring / signature parity gates).docs/source/reference/geotiff.rstvia docutils.