L1: Structural validation¶
Terms¶
- Structural check
A check on the store’s node layout: which nodes exist, the root attribute blocks, and the rank of the per-chunk arrays’ cell grids. It reads no cell data.
- Level group
A group under the store root whose name is an integer (
0/,1/, …). Other root members, such asparametric/, are not levels.
Introduction¶
L1 checks that the store opens, that the root has Zarr Vectors metadata,
that each level has its required nodes, and that each level’s per-chunk
arrays share one chunk-grid rank. It works through the store API, so it
runs on local paths, URLs, open Group handles and any backend a reader
can open. Rules per geometry type are at L4 (see
Validation overview).
Technical reference¶
L1 is validate_structure in zarr_vectors/validate/structure.py. Each
check adds a message to the ValidationResult (see
Validation overview). N is the level.
Root¶
Check |
Severity |
Message |
|---|---|---|
The store opens (path, URL or open |
error |
|
The root attributes have a |
error |
|
The root attributes have an RFC 8 |
warning |
|
At least one level group exists; L1 stops if not |
error |
|
The ome node is optional (format 0.9.2): a store without one is valid
and readable, but an OME collection cannot resolve it as a member. The
warning names the fix, zarr_vectors.building.stamp_ome_node(store),
which adds the node without rewriting data.
Each level¶
Check |
Severity |
Message |
|---|---|---|
The level group opens; the level is skipped if not |
error |
|
Every node under the level has readable metadata; the level is skipped if not |
error |
|
|
error |
|
|
warning |
|
The level’s attributes are not empty |
warning |
|
|
warning |
|
The per-chunk arrays can be listed |
warning |
|
The level checks themselves run |
error |
|
vertex_attributes/, fragment_attributes/, object_index/,
object_attributes/, groups/ and the root’s parametric/ add a pass
message when present and nothing when absent. Offsets names under
links/<delta>/ are checked at L3.
Chunk grid rank¶
A level’s per-chunk arrays (vertices, vertex_fragments,
vertex_attributes/<n>, fragment_attributes/<n>, links/<d>/<off>,
link_attributes/…) share one rank: sid_ndim, plus one when the level
is chunked by an attribute. object_index/, object_attributes/ and
groups/ are not checked. All findings are errors.
Check |
Message |
|---|---|
Every key in an array’s |
|
Every per-chunk array has the rank of |
|
With |
|
With |
|
An array with no nonempty_chunks lists no keys, which is not an error
(a record_presence=False write leaves it so until presence is rebuilt).
A level whose chunk_attribute_values does not parse is reported at L2
and skipped here.
Example¶
A two-level line store whose level 1 lost vertices/ and
vertex_fragments/:
Level 1 validation: FAIL
15 passed, 1 warnings, 1 errors
ERROR: 1/vertices/ missing
WARN: 1/vertex_fragments/ missing
To run L1 alone:
from zarr_vectors.validate.structure import validate_structure
print(validate_structure("contacts.zarrvectors").summary())