Add VRT support contract docs (#2368)#2374
Open
brendancol wants to merge 3 commits into
Open
Conversation
Document VRT as a conservative advanced feature for simple GeoTIFF mosaics rather than full GDAL VRT compatibility. Adds the supported subset and out-of-scope lists from epic #2342 to the read_vrt docstring in xrspatial/geotiff/_vrt.py, a pointer in the public read_vrt and open_geotiff docstrings, a "VRT support contract" section in docs/source/reference/geotiff.rst, and a one-line note in the README's GeoTIFF / COG I/O section. Docs and docstrings only. No production logic changes. Closes #2368. Part of #2342.
brendancol
commented
May 25, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: Add VRT support contract docs (#2368)
Docs-only PR. Steps 2 (numerical correctness), 3 (backend dispatch), and 4 (perf) don't apply. The review below focuses on docstring layout, link correctness, and consistency with epic #2342.
Blockers
None.
Suggestions
- README link
docs/source/reference/geotiff.rst#vrt-support-contract(README.md:153) relies on GitHub's RST renderer producing the slugvrt-support-contractfor theVRT support contractsection. That's the common case but not guaranteed across all renderers. Worth a manual check once the PR is rendered; if it doesn't resolve to the section, fall back to the bare file path or to a published Sphinx URL. xrspatial/geotiff/_vrt.py:1011-1044: the new "Supported subset" and "Not supported" blocks sit between themask_nodataParameters entry andReturns. Napoleon (which this project uses for Sphinx) handles this fine. Strict numpydoc-style readers warn about unknown sections. Moving the contract into aNotessection right afterReturnswould parse cleanly under both. Also worth coordinating with sibling PR 1 of epic #2342, which is editing the same file.
Nits
xrspatial/geotiff/_vrt.py:1013reads "VRT here is a conservative advanced feature...". The rst and the__init__.pysnippet both lead with "The VRT path is...". Matching the three intros would make the contract look like one voice rather than three.docs/source/reference/geotiff.rst:190: the new label.. _reference.geotiff.vrt_support_contract:uses dot-separated segments. The rest of the file does not follow one local convention strictly, so this is fine; flagging only in case there is a preference elsewhere indocs/.- The Markdown anchor (
#vrt-support-contract) and the Sphinx label (vrt_support_contract) target different systems but look like a near-miss to a skim-reader. Not worth fixing, just noting.
What looks good
- Lists in the four touched files match epic #2342 verbatim.
- The internal
_vrt.read_vrtcarries the full lists; the public backendread_vrtandopen_geotiffcarry only pointers, matching the brief's "do not duplicate". - Placement of the new rst section right before "VRT missing sources" makes the contract read first and the policy detail second, which is the right order for a first-time user.
- README link points at the GitHub-renderable rst path, not a docs URL that may not exist yet.
Checklist (docs-only)
- Lists match epic #2342 in all four locations
- Docstrings parse (
ast.parseclean, runtime__doc__populated) - Sphinx (Napoleon) accepts the new docstring layout
- README link target file exists
- No production logic changes
- [n/a] Backend dispatch, NaN handling, dask correctness, benchmark coverage
Move the "Supported subset" / "Not supported" blocks in
xrspatial/geotiff/_vrt.py:read_vrt out from between Parameters and
Returns and into a proper Notes section. Strict numpydoc-style
readers warn on unknown section headers; the Notes section is a
standard numpydoc/Napoleon header that allows free-form prose plus
inline-emphasis subsection labels.
Also aligns the intro line with the public read_vrt and open_geotiff
docstrings ("The VRT path is a conservative advanced feature...") so
the three surfaces read as one voice.
Reviewer dispositions:
- Fix: numpydoc parse cleanliness (this commit)
- Fix: consistent intro phrasing (this commit)
- Defer: README anchor verification (needs rendered PR view)
- Dismiss: label naming, anchor near-miss (reviewer flagged as
non-issues)
brendancol
commented
May 25, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review after f8c3140
Disposition of the original review findings:
Fixed (in f8c3140):
- Suggestion 2 (numpydoc parse cleanliness): the "Supported subset" / "Not supported" blocks in
xrspatial/geotiff/_vrt.py:read_vrtare now inside a properNotessection afterReturns, with the subsection labels rendered as inline-emphasis (*Supported:*,*Not supported.*) rather than as ad-hoc headings. Confirmed locally:numpydoc.docscrape.NumpyDocStringparses with noUserWarning, and the seven Parameters + the single unnamed Returns entry are still recognised. - Nit 1 (intro phrasing): the intro now reads "The VRT path is a conservative advanced feature scoped to simple GeoTIFF mosaics..." matching the rst section and the
open_geotiffsnippet word for word, so the three surfaces are consistent.
Deferred:
- Suggestion 1 (README anchor verification): no production-side fix is appropriate without rendering the PR on GitHub to confirm whether
docs/source/reference/geotiff.rst#vrt-support-contractresolves to the new section. The link target file is correct, so the worst case is a non-anchored scroll to the top of the file rather than a 404. If the rendered view shows the anchor doesn't resolve, the fix is a follow-up commit changing the README to the bare file path or to a published Sphinx URL once docs are deployed.
Dismissed:
- Nit 2 (rst label naming convention): the
.. _reference.geotiff.vrt_support_contract:label uses dot-separated segments. The reviewer noted the rest of the file does not follow one strict convention, so there is nothing to align against. - Nit 3 (Markdown anchor vs Sphinx label near-miss): the two targets are unrelated systems and the reviewer flagged this as "not worth fixing".
No new blockers.
# Conflicts: # docs/source/reference/geotiff.rst # xrspatial/geotiff/__init__.py
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 #2368.
Part of epic #2342 (PR 5 of 5).
Summary
read_vrtdocstring inxrspatial/geotiff/_vrt.py, and a new "VRT support contract" section indocs/source/reference/geotiff.rstplaced right before the existing "VRT missing sources" section.read_vrtdocstring inxrspatial/geotiff/_backends/vrt.pyand toopen_geotiffinxrspatial/geotiff/__init__.py.GeoTIFF / COG I/Osection.Scope
Docs and docstrings only. No production logic changes. The validator behaviour, positive tests, negative tests, and missing-source policy tests are tracked in sibling PRs under epic #2342.
Backend coverage
N/A. This PR does not touch runtime code.
Test plan
python -c "import xrspatial.geotiff"andpython -c "from xrspatial.geotiff import open_geotiff, read_vrt"succeed with the new docstrings present.ast.parsepasses on every edited.pyfile.docs/source/reference/geotiff.rst#vrt-support-contractresolves on GitHub's Markdown view.