Validation

Conformance validator with levels 1 to 5, each including those below. Validation overview says what each level checks. validate(store, level=N) runs levels 1 to N (default 3) and returns a ValidationResult. zarr_vectors.validate is undecided: treat it as internal.

Unified validation — runs levels 1–5 cumulatively.

zarr_vectors.validate.validate(store_path, *, level=3)[source]

Validate a zarr vectors store at the specified conformance level (1–5).

Parameters:
Return type:

ValidationResult

ValidationResult

class zarr_vectors.validate.ValidationResult(level, passed=<factory>, warnings=<factory>, errors=<factory>)[source]

Bases: object

Accumulated validation outcome.

Parameters:
__init__(level, passed=<factory>, warnings=<factory>, errors=<factory>)
Parameters:
Return type:

None

add_error(msg)[source]
Parameters:

msg (str)

Return type:

None

add_pass(msg)[source]
Parameters:

msg (str)

Return type:

None

add_warning(msg)[source]
Parameters:

msg (str)

Return type:

None

errors: list[str]
level: int
merge(other)[source]
Parameters:

other (ValidationResult)

Return type:

None

property ok: bool
passed: list[str]
summary()[source]
Return type:

str

warnings: list[str]

Individual validation modules

Level 1 structural validation — verify the store layout on disk.

zarr_vectors.validate.structure.validate_structure(store_path)[source]

Level 1: verify the store’s structure.

Asked of the store, not of a filesystem. This used to be pure pathlib – Path(store_path).exists() and iterdir() – which made level 1 the one validator that could only ever see a local directory. Worse, it could not see the local ones either when reached through the api: Dataset.validate() passes Group.url, and Path("file:///C:/...") does not exist, so every api-driven validation failed at level 1 and returned before doing anything else.

Accepts a path, a URL or an open Group.

Parameters:

store_path (str | Path | Group)

Return type:

ValidationResult

Level 2 metadata validation — verify metadata is well-formed.

zarr_vectors.validate.metadata.level_fields(root, li, lg)[source]

The level’s metadata fields as stored, uncoerced, so a malformed value reaches the check that reports it.

Precedence: the level’s zarr_vectors object > legacy top-level keys (see read_level_metadata()). Level 0’s bin is the root’s base_bin_shape, so bin fields on level 0 are dropped.

Parameters:
Return type:

dict

zarr_vectors.validate.metadata.validate_metadata(store_path)[source]

Level 2: verify all metadata is well-formed.

Parameters:

store_path (str | Path | Group)

Return type:

ValidationResult

Level 3 consistency validation — verify data arrays are internally consistent.

zarr_vectors.validate.consistency.validate_consistency(store_path)[source]

Level 3: verify internal data consistency.

Parameters:

store_path (str | Path | Group)

Return type:

ValidationResult

Level 4-5 conformance validation — geometry rules and multi-resolution.

zarr_vectors.validate.conformance.validate_conformance(store_path)[source]

Level 4: verify geometry-specific conformance.

Parameters:

store_path (str | Path | Group)

Return type:

ValidationResult

zarr_vectors.validate.conformance.validate_multiresolution(store_path)[source]

Level 5: verify multi-resolution pyramid conformance.

Parameters:

store_path (str | Path | Group)

Return type:

ValidationResult