@@ -14,7 +14,7 @@ Two layers and an optional integration:
1414 specifications, plus types for [ ` zarr-extensions ` ] ( https://github.com/zarr-developers/zarr-extensions/ )
1515 and a few widely-used-but-unspecified entities (e.g. consolidated metadata).
1616- ** Document models** (` zarr_metadata.model ` ): canonical frozen-dataclass
17- models of whole metadata documents, with structural validators, loc-aware
17+ models of whole metadata documents, with validators, loc-aware
1818 parsers, and store-key (de)serialization. A document produced by ` to_json `
1919 shares no mutable state with the model that produced it.
2020- ** Optional Pydantic integration** (` zarr_metadata.pydantic ` , requires
@@ -56,11 +56,20 @@ members that the strict model parser rejects.
5656
5757The model validators enforce the declared document structure and a small set
5858of context-free consistency rules, including fixed format literals, finite
59- JSON numbers, non-negative dimensions, non-empty v3 codec pipelines, and one
60- ` dimension_names ` entry per array dimension. They do not interpret extension
61- names or configurations, resolve codec pipelines, or decide whether a data
62- type, chunk grid, codec, or storage transformer is supported. Those decisions
63- belong to consumer implementations.
59+ JSON numbers, non-negative dimensions, and one ` dimension_names ` entry per
60+ array dimension. In a v3 document they also read
61+ each extension point -- the data type, chunk grid, chunk key encoding, each
62+ codec and each storage transformer -- through the definition that claims its
63+ name in a scope, ` CORE_AND_EXTENSIONS ` unless a ` context ` is passed: a
64+ configuration its definition refuses is refused, and a key it does not
65+ declare is reported as ` unknown_key ` . A name nothing in the scope claims is
66+ left unjudged, and whether to support it is the consumer's decision. A v3
67+ fill value is judged against the data type it names, by that data type's
68+ definition, the chunk grid against the shape, by the grid's definition,
69+ and the codecs as a pipeline: in order, each judged by its definition
70+ against the chunk it is handed, a shard's inner and index codecs too.
71+ The validators do no arithmetic on values: whether a fill value survives
72+ a ` cast_value ` round trip is not judged.
6473
6574The Pydantic integration's generated JSON Schemas express independently
6675checkable document structure and field constraints, but they are not a
@@ -75,7 +84,7 @@ versus `shape`. Consumers should run the model parser after schema validation.
7584At minimum, this library supports what Zarr-Python needs: the complete
7685Zarr v2 and v3 specs, consolidated metadata, and a subset of the metadata
7786defined in ` zarr-extensions ` . We are generally open to contributions that
78- add types, models, or structural validation for Zarr metadata with a
87+ add types, models, or validation for Zarr metadata with a
7988published spec.
8089
8190Runtime array behavior is out of scope: nothing here encodes or decodes
0 commit comments