L2: Metadata validation¶
Terms¶
- Schema check
A validation check that reads a
.zattrsorzarr.jsonfile and verifies that its values conform to the ZVF specification — correct types, valid ranges, required keys present, cross-key consistency.- Divisibility constraint
The requirement that
chunk_shape[d] % bin_shape[d] == 0for alld. Checked at L2 using floating-point tolerance.- Floating-point tolerance
The permissible difference between two floating-point values when checking equality. For divisibility checks, ZVF uses a tolerance of
1e-6 × chunk_shape[d]per axis.- Array metadata consistency
The agreement between the shape and dtype declared in each array’s
zarr.jsonand the values declared in the store’s.zattrs.
Introduction¶
L2 validation reads all .zattrs and zarr.json metadata files and
checks that their contents are internally consistent and conform to the
ZVF specification. No array data is read.
L2 catches the most common class of write-time bugs: mis-typed keys, invalid ranges, dimensionality mismatches between chunk_shape and bin_shape, array shapes that are inconsistent with the declared chunk grid, and multiscale metadata that does not match the level groups actually present in the store.
Technical reference¶
Root .zattrs checks¶
Check |
Rule |
Failure type |
|---|---|---|
|
|
Error |
|
|
Warning (unknown version) |
|
|
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
All elements of |
Error |
|
All elements of |
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
Level 0 entry has |
Error |
|
Level 0 |
Error |
|
|
Error |
|
Each |
Error |
|
|
Warning |
|
|
Warning |
Per-level .zattrs checks¶
Check |
Rule |
Failure type |
|---|---|---|
|
|
Error |
|
|
Error |
|
All elements of |
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
Point cloud stores have |
Error |
|
|
Warning |
|
|
Error |
Array zarr.json checks¶
Check |
Rule |
Failure type |
|---|---|---|
|
|
Warning (other float types accepted with warning) |
|
|
Error |
|
|
Error |
|
Every non-empty chunk’s blob starts with magic |
Error |
|
|
Error |
|
|
Warning if |
|
|
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
|
Error |
Multiscale metadata checks¶
Check |
Rule |
Failure type |
|---|---|---|
|
Each level entry has |
Error |
|
Each level has exactly one |
Error |
|
|
Error |
|
|
Error |
|
|
Error |
|
Each axis has |
Warning |
Streamline-specific checks¶
Check |
Rule |
Failure type |
|---|---|---|
|
|
Error |
|
|
Warning |
Example L2 report¶
Level 2 validation of tracts.zarrvectors
==========================================
PASS version_present zarr_vectors_version present
PASS geometry_type_valid geometry_type = "streamline"
PASS spatial_dims_type spatial_dims = 3
PASS divisibility [d=0] 200.0 % 50.0 = 0.0 ✓
PASS divisibility [d=1] 200.0 % 50.0 = 0.0 ✓
PASS divisibility [d=2] 200.0 % 50.0 = 0.0 ✓
PASS level_0_present multiscales contains level 0
PASS bin_ratio_consistent [1] bin_shape [100,100,100] = base [50,50,50] × ratio [2,2,2] ✓
PASS scale_values [level=1] scale [2.0,2.0,2.0] = bin_ratio [2,2,2] ✓
PASS translation_values [1] translation [50,50,50] = bin_shape/2 [50,50,50] ✓
PASS vertex_fragments_dtype [0] zv_array = "vertex_fragments", encoding = "fragment_index_v1" ✓
WARN step_size_unit_valid step_size_unit "voxels" not in recommended vocabulary
PASS sparsity_range [level=1] 0.5 in (0, 1] ✓
Level 2 validation: PASS — 14 passed, 1 warning, 0 errors