Document PAM categorical sidecar behavior on open_geotiff/to_geotiff (#3592)#3598
Merged
Merged
Conversation
brendancol
commented
Jul 2, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: Document PAM categorical sidecar behavior (#3592)
Doc-only PR: two docstring additions and two new attrs-contract rows. Reviewed by checking each documented claim against the code rather than the usual backend/numerics checklist, most of which does not apply here.
Blockers
None.
Suggestions
None.
Nits
-
xrspatial/geotiff/__init__.py(open_geotiff Notes): "Local string-path reads also pick up categorical metadata" is scoped correctly, but a reader might wonder about URL string sources. The lookup runs for any string source and simply never matches a remote URL (os.path.existsonurl + '.aux.xml'is False), so the text is accurate as written. Fine to leave.
Verified claims
- The "every backend" read claim matches the four
_attach_category_attrscall sites (eager, dask, GPU, VRT) inxrspatial/geotiff/__init__.py. - The "every dispatch path" write claim matches the four
_write_sidecars()call sites inxrspatial/geotiff/_writers/eager.py, including the.vrtpath. - "Categorical wins when both apply" matches the
color_ramp and not _cat_names and not packgate. - The color length-mismatch rule in the new
category_colorsrow matchesbuild_pam_xml's write-side check. - Round-trip, dask merge, VRT sidecar emit, and stats-only-sidecar rejection were all executed against the branch and behave as documented.
parity/test_signature_contract.py(25), the docstring assertion suites (255), and the PAM-focused subset (143) all pass with the new text.
The issue number cited in the rst row (#3482) is the original issue rather than the implementing PR (#3483), which matches how other rows cite provenance.
brendancol
added a commit
that referenced
this pull request
Jul 2, 2026
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 #3592
Doc-only.
to_geotiffwrites a PAM.aux.xmlsidecar whenever the DataArray carriesattrs['category_names'], andopen_geotiffmergescategory_names/category_colorsback from that sidecar on local reads. The behavior landed in #3483 and is tested; it just wasn't written down anywhere.open_geotiff: new Notes paragraph covering the sidecar merge (all four read paths, fail-safe on missing/malformed/foreign sidecars, file-like sources skip it).to_geotiff: new description paragraph covering the categorical sidecar write (keyed on attrs alone, every dispatch path including.vrt, file-like destinations skip it, categorical wins overcolor_ramp).docs/source/user_guide/attrs_contract.rst: rows forcategory_namesandcategory_colors, with the sidecar caveat and the length-mismatch rule for colors.No behavior changes. Backend coverage n/a (docs only).
Each documented claim was executed against the code before writing it down: categorical round-trip on the eager, dask, and VRT read paths; sidecar emitted from the
.vrtwriter; a stats-only foreign sidecar ignored on read; colors dropped on length mismatch (write-side check inbuild_pam_xml).Test plan:
xrspatial/geotiff/tests/parity/test_signature_contract.py(25 passed)test_polish.py,unit/test_signatures.py,parity/test_reference.py(255 passed)-k "pam or sidecar or categor"across the geotiff suite (143 passed)Found by the documentation sweep. The sweep state CSV update rides along on this branch.