Skip to content

Latest commit

 

History

History
41 lines (38 loc) · 2.49 KB

File metadata and controls

41 lines (38 loc) · 2.49 KB

The document (TypedDict) types are renamed to put the format version at the front of the name and to mark the JSON-document form with a JSON suffix, so a format version can never be misread as a class revision and the bare entity names are reserved for the zarr_metadata.model dataclasses:

  • ArrayMetadataV2ZarrV2ArrayMetadataJSON (and ...Partial accordingly)
  • ArrayMetadataV3ZarrV3ArrayMetadataJSON (and ...Partial accordingly)
  • GroupMetadataV2ZarrV2GroupMetadataJSON (and ...Partial accordingly)
  • GroupMetadataV3ZarrV3GroupMetadataJSON (and ...Partial accordingly)
  • ConsolidatedMetadataV2ZarrV2ConsolidatedMetadataJSON
  • ConsolidatedMetadataV3ZarrV3ConsolidatedMetadataJSON
  • NamedConfigV3ZarrV3NamedConfigJSON
  • MetadataV3ZarrV3MetadataFieldJSON (the union of the bare-name and named-configuration spellings of one metadata field)
  • ExtensionFieldV3ZarrV3ExtensionField
  • CodecMetadataV2ZarrV2CodecMetadata
  • DataTypeMetadataV2ZarrV2DataTypeMetadata
  • ArrayOrderV2ZarrV2ArrayOrder
  • ArrayDimensionSeparatorV2ZarrV2ArrayDimensionSeparator
  • ZArrayMetadataZarrV2ZArrayJSON (the strict on-disk .zarray document)
  • ZGroupMetadataZarrV2ZGroupJSON (the strict on-disk .zgroup document)
  • ZAttrsMetadataZarrV2ZAttrsJSON (the .zattrs document)

The old names are removed, not aliased. The zarr_metadata.pydantic field types take the bare entity names (ZarrV3ArrayMetadata, ...), matching the model classes they validate into.

The conventions, stated once for future additions: CamelCase type names put the format version first (ZarrV2ArrayMetadataJSON, ZarrV3ArrayMetadataStoreKey), while SCREAMING_SNAKE constants and snake_case functions put it last (ARRAY_METADATA_STORE_KEY_V2, validate_array_metadata_v3). The JSON suffix marks a raw-document type whose bare name is taken by (or reserved for) a zarr_metadata.model dataclass; raw field-level types the models hold verbatim (ZarrV2CodecMetadata, ZarrV3ExtensionField) keep their bare names. Extension-entity types put the registered entity name first and end in exactly one role suffix (BloscCodecMetadata, Uint8DataTypeName) — the V2 in V2ChunkKeyEncodingMetadata is that encoding's entity name, not a format version, which is always spelled ZarrV2/ZarrV3. Every public type name is checked against this grammar by tests/test_public_api.py::test_public_type_names_comply_with_naming_grammar.