refactor(conventions): source convention identity & validation from zarr-cm#20
Open
d-v-b wants to merge 1 commit into
Open
refactor(conventions): source convention identity & validation from zarr-cm#20d-v-b wants to merge 1 commit into
d-v-b wants to merge 1 commit into
Conversation
…arr-cm Closes zarr-developers#19. zarr-cm is the shared, minimal-dependency Python implementation of the Zarr conventions metadata. This de-duplicates functionality by depending on it as the single source of truth, while keeping geozarr-toolkit's richer Pydantic models and geospatial value-adds. - Add `zarr-cm>=0.4.1` dependency. - Source each convention's identity (UUID, schema_url, spec_url, description) from zarr-cm instead of hardcoding it. The spatial/proj schema/spec URLs now point at zarr-cm's commit-pinned snapshots (the old `refs/tags/v0.1` URLs for those two conventions 404 upstream). - Delegate structural validation rules to zarr-cm where the behavior matches: - `ZarrConventionMetadata`: the "at least one identifier" rule. - `Proj`: the "at least one CRS" rule (the stricter `^[A-Z]+:[0-9]+$` code pattern and the pyproj resolution check remain geozarr-specific additions). - `Multiscales`: full layout validation, which adds enforcement of the spec rule that a `derived_from` level must also carry a `transform`. - `validate_zarr_conventions` helper: the per-CMO identifier rule. Spatial validation is intentionally NOT delegated: zarr-cm's shipped spatial revisions are strict-2D, whereas geozarr-toolkit supports N-D dimensions. A test that constructed a `derived_from` level without a `transform` (invalid per the spec) is fixed, and a test for the newly enforced rule is added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for geozarrdemonstration4e8c9 canceled.
|
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Member
|
Thanks, @d-v-b. Does zarr-cm provide anything for the attributes defined by the convention, or is it just for the convention metadata object itself? |
Author
|
It aims to provide both -- see https://zarr-cm.readthedocs.io/en/latest/api/#zarr_cm.spatial.SpatialAttrs and https://zarr-cm.readthedocs.io/en/latest/api/#zarr_cm.spatial.SpatialConventionAttrs. The former is the core convention attributes, and the latter includes the convention attributes + the CMO |
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 #19.
zarr-cm is the shared, minimal-dependency Python implementation of the Zarr
conventions metadata. This de-duplicates functionality by depending on it as
the single source of truth, while keeping geozarr-toolkit's richer Pydantic
models and geospatial value-adds.
zarr-cm>=0.4.1dependency.from zarr-cm instead of hardcoding it. The spatial/proj schema/spec URLs now
point at zarr-cm's commit-pinned snapshots (the old
refs/tags/v0.1URLs forthose two conventions 404 upstream).
ZarrConventionMetadata: the "at least one identifier" rule.Proj: the "at least one CRS" rule (the stricter^[A-Z]+:[0-9]+$codepattern and the pyproj resolution check remain geozarr-specific additions).
Multiscales: full layout validation, which adds enforcement of thespec rule that a
derived_fromlevel must also carry atransform.validate_zarr_conventionshelper: the per-CMO identifier rule.Spatial validation is intentionally NOT delegated: zarr-cm's shipped spatial
revisions are strict-2D, whereas geozarr-toolkit supports N-D dimensions.
A test that constructed a
derived_fromlevel without atransform(invalidper the spec) is fixed, and a test for the newly enforced rule is added.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com