Validation overview¶
Terms¶
- Conformance level
An integer from 1 to 5 setting how deep a validation run goes. A run at level
Nruns the checks of every level up toN.- Check
One assertion made during validation. It adds a message to the passed, warnings or errors list. Checks have no ids.
- Warning
A finding that does not make the store invalid but may matter to some readers, such as a missing RFC 8
omenode.- Error
A finding that makes the store non-conforming at the level run, such as a
base_bin_shapethat does not dividechunk_shape.
Introduction¶
zarr_vectors.validate.validate() checks a store at one of five levels.
Run it after writing, converting or rechunking a store. Writers check
their arguments but not the data they write, so run at least level 3
after writing a new kind of store.
Technical reference¶
Conformance levels¶
Level |
Name |
Checks |
Reads |
Page |
|---|---|---|---|---|
1 |
Structural |
Store opens; root metadata and |
metadata |
|
2 |
Metadata |
Root and level attribute values; per-level |
metadata |
|
3 |
Consistency |
Chunks decode; |
every chunk |
|
4 |
Geometry conventions |
|
metadata |
|
5 |
Pyramid |
Level numbering; vertex counts per level; |
metadata; every chunk of a level without |
There is no sampling option; to bound the cost, run at level 2.
No level checks the multiscales block or the zarr_conventions
registrations.
Level 4: geometry conventions¶
validate_conformance in zarr_vectors/validate/conformance.py. It
checks metadata, not topology or geometry.
Check |
Severity |
Message |
|---|---|---|
Each type in |
warning |
|
|
error |
|
Level 0 exists; if not, the remaining checks are skipped |
warning |
|
Mesh: |
error |
|
Mesh: link metadata exists |
warning |
|
Point cloud without graph, skeleton or mesh: no |
warning |
|
Geometry type |
Allowed |
|---|---|
|
any |
|
|
|
|
|
|
Level 5: pyramid¶
validate_multiresolution in zarr_vectors/validate/conformance.py. A
store with one level passes. All findings are errors. Level fields are
read from the level’s zarr_vectors object (top-level keys are a
fallback).
Check |
Message |
|---|---|
Levels are numbered |
|
No level has more vertices than the level before. Uses |
|
|
|
|
|
Each level can be read |
|
L5 does not compare object counts, bin shapes or vertex correspondence between levels.
Python API¶
from zarr_vectors.validate import validate
result = validate("contacts.zarrvectors", level=5)
print(result.summary())
# Level 5 validation: PASS
# 25 passed, 0 warnings, 0 errors
validate(store, *, level=3) takes a path, URL or open Group. A
level outside 1–5 raises ValueError. Dataset.validate(level=...)
does the same on an open dataset. The zvtools validate command is in
zarr-vectors-tools.
Levels run in order. An L1 error ends the run after L1; an L2 error ends
it after L2 when level >= 3. L3, L4 and L5 always run in full. So a
failing store may have more errors than reported; re-run after each fix.
ValidationResult API¶
Member |
Type |
Meaning |
|---|---|---|
|
|
The level |
|
|
|
|
|
Messages of checks that passed |
|
|
Warning messages |
|
|
Error messages |
|
|
Status line, counts, then every error and warning |
|
|
Appends another result’s three lists |
Messages are plain strings and are not a stable interface.