Summary
Part of epic #2211. Phase 4 deliverable: finish the work started in #2162 — move every remaining attrs-population call into GeoTIFFMetadata / the finalization helpers, so every read backend stamps the same canonical keys for equivalent inputs.
Scope
Refactor + table-driven attrs parity test. No public API change.
Files
- Modify:
xrspatial/geotiff/_attrs.py — make GeoTIFFMetadata.finalize() (and its lazy variant) the single attrs entry point. Absorb any per-backend attrs population still living in _reader.py, _vrt.py, _backends/*.
- Modify: each backend module to call
finalize() (or the lazy variant) rather than building attrs inline.
- Create:
xrspatial/geotiff/tests/test_attrs_finalization_parity_2211.py — table-driven comparison across backends, excluding documented backend-specific keys.
Acceptance
- Every attrs key defined in
_attrs.py's canonical schema is stamped by finalize() / the lazy helper, not by ad-hoc da.attrs[k] = v in backends.
- Table-driven parity test asserts identical attrs across eager / Dask / GPU (when available) / VRT for the same input fixture.
test_attrs_contract_*.py and test_attrs_parity_1548.py still pass.
- No public API change.
Prior art
PRs #2200, #2205, #2207, #2209 from epic #2162 established the shared finalization helpers for eager + dask + VRT. This PR finishes the migration so no backend writes attrs directly.
Closes part of #2211.
Summary
Part of epic #2211. Phase 4 deliverable: finish the work started in #2162 — move every remaining attrs-population call into
GeoTIFFMetadata/ the finalization helpers, so every read backend stamps the same canonical keys for equivalent inputs.Scope
Refactor + table-driven attrs parity test. No public API change.
Files
xrspatial/geotiff/_attrs.py— makeGeoTIFFMetadata.finalize()(and its lazy variant) the single attrs entry point. Absorb any per-backend attrs population still living in_reader.py,_vrt.py,_backends/*.finalize()(or the lazy variant) rather than building attrs inline.xrspatial/geotiff/tests/test_attrs_finalization_parity_2211.py— table-driven comparison across backends, excluding documented backend-specific keys.Acceptance
_attrs.py's canonical schema is stamped byfinalize()/ the lazy helper, not by ad-hocda.attrs[k] = vin backends.test_attrs_contract_*.pyandtest_attrs_parity_1548.pystill pass.Prior art
PRs #2200, #2205, #2207, #2209 from epic #2162 established the shared finalization helpers for eager + dask + VRT. This PR finishes the migration so no backend writes attrs directly.
Closes part of #2211.