L2: Metadata validation¶
Terms¶
- Divisibility constraint
Each axis’s chunk size must be an integer multiple of its bin size, so bins tile chunks. L2 requires
abs(chunk_shape[d] / bin_shape[d] - round(...)) <= 1e-9.
Introduction¶
L2 reads the root and level attributes and checks their values. It reads
no array data, no array zarr.json and no link family (links are checked
at L3).
Technical reference¶
L2 is validate_metadata in zarr_vectors/validate/metadata.py. Each
check adds a message to the ValidationResult (see
Validation overview). All findings
below are errors unless marked.
Root¶
Check |
Message |
|---|---|
The store opens; L2 stops if not |
|
The root metadata parses (required keys and types); L2 stops if not. A 0.9.x store fails here with |
|
|
|
|
|
|
|
Every |
|
|
|
|
|
|
|
|
|
|
|
|
|
Every |
|
|
|
Each level¶
Level fields are read from the level’s zarr_vectors object, with
top-level keys as a fallback. bin_shape and bin_ratio are not checked
at level 0, which uses the root base_bin_shape; at a coarser level the
checks see the level’s own bins.
Check |
Message |
|---|---|
The level’s metadata can be read |
|
Presence is not deferred: the arrays carry |
|
|
|
A per-level |
|
|
|
Every |
|
|
|
|
|
|
|
Octree capabilities¶
Once per store, for each of the root’s format_capabilities and
required_capabilities. Both are warnings and suggest
zarr_vectors.octree_chunks.refresh_capabilities(store).
Check |
Message |
|---|---|
A level with octree chunks means the list has |
|
|
|
Not checked at L2¶
Link families and link attributes.
Array metadata:
vertices/dtype,vertex_fragments/encoding.The
multiscalesblock,zarr_conventionsandproj:projjson.Rules per geometry type (L4).
Example¶
A point-cloud store with empty geometry_types and a base_bin_shape
that does not divide chunk_shape (the pass count includes L1).
RootMetadata.validate() and the explicit divisibility check both report
the bad base_bin_shape:
Level 2 validation: FAIL
19 passed, 1 warnings, 2 errors
ERROR: Root metadata invalid: chunk_shape[0]=200.0 is not an integer multiple of base_bin_shape[0]=30.0 (ratio=6.666667)
ERROR: chunk_shape[0]=200.0 not integer multiple of base_bin_shape[0]=30.0
WARN: No geometry_types specified