Add read support for Zarr spatial and proj conventions#905
Open
emmanuelmathot wants to merge 4 commits intocorteva:masterfrom
Open
Add read support for Zarr spatial and proj conventions#905emmanuelmathot wants to merge 4 commits intocorteva:masterfrom
emmanuelmathot wants to merge 4 commits intocorteva:masterfrom
Conversation
- Add Convention.Zarr enum value - Create _convention/zarr.py module with ZarrConvention class implementing ConventionProtocol for reading CRS, transform, and spatial dimensions - Support proj:wkt2, proj:code, proj:projjson for CRS reading - Support spatial:transform, spatial:dimensions for transform and dimension reading - Register ZarrConvention in _core.py's _CONVENTION_MODULES - Both conventions are tried when reading regardless of setting (priority changes only) - Add comprehensive unit tests for Zarr convention parsing and reading - Add integration tests for Zarr convention with rio accessor Note: Writing support will be implemented in a future PR.
3 tasks
- Rename Convention.Zarr to Convention.ZARR for UPPER_CASE naming style - Replace broad 'except Exception' with specific exceptions (KeyError, TypeError, ValueError)
snowman2
reviewed
Feb 4, 2026
snowman2
reviewed
Feb 4, 2026
snowman2
reviewed
Feb 4, 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.
Add read support for Zarr spatial and proj conventions
This is the second in a series of PRs splitting #883 as requested by maintainers. Depends on #899, #903, #904.
Changes:
Convention.ZARRenum value torioxarray.enumZarrConventionclass implementingConventionProtocolZarrConventionin _core.py's_CONVENTION_MODULESfor automatic convention detectionproj:wkt2,proj:code,proj:projjsonfor CRS readingspatial:transform,spatial:dimensionsfor transform and dimension readingzarr_conventionsattributeArchitecture:
ZarrConventionclass implementsread_crs(),read_transform(),read_spatial_dimensions()NotImplementedError(to be implemented in future PRs)Reviewer feedback addressed:
CRS.from_user_input()for CRS parsingConventionProtocolinterface from REF:convention: Reorganize convention modules & use rio accessor grid mapping methods #903Future PRs:
write_crs(convention=Convention.Zarr))write_transform(convention=Convention.Zarr))