Repairing known writer bugs¶
The readers are strict. If a known writer bug made a document invalid, the readers report problems.
The repair readers in zarr_metadata.model handle these documents:
read_repaired_node_metadata_v3read_repaired_node_metadata_v2read_repaired_consolidated_metadata_v2
Each one works in three steps:
- Undo the known bugs.
- Read the result strictly.
- Return each change it made as a
Repair.
Bugs the repair readers undo¶
- A chunk length of 0 along an empty dimension, in a v3
regularchunk grid. zarr-python 3.0 and 3.1 wrote it. The repair writes 1. consolidated_metadata: nullon a v3 group. zarr-python 3.0 and 3.1 wrote it. The spec requires an object. The repair removes the key.- A
consolidated_metadatamember in a.zgroupentry of a.zmetadata, below the root. zarr-python 3 writes it. The v2 spec allows no key butzarr_formatin a.zgroup. The repair removes the member. - A bare
NaN,Infinityor-Infinityas a v2 fill value. zarr-python 3.0.0 to 3.0.6 wrote it. The repair writes the string the v2 spec uses, such as"NaN". - A bare non-finite float or complex fill value in a v3 group's
consolidated metadata. zarr-python 3.0.0 to 3.0.6 wrote it. The repair
writes the string the
v3 spec
uses, such as
"NaN".
Bugs the repair readers do not undo¶
A document with one of these bugs is refused:
- The fill value of an
SorVarray as a JSON array of byte values, in a.zmetadataentry. zarr-python 3.0.7 to 3.0.10 wrote it. The array's own.zarrayfile holds the base64 string the v2 spec requires, and the package reads that file. - The fill value of a v2 datetime array as an ISO 8601 string, not as a count of ticks. zarr-python 3.0.7 and 3.0.8 wrote it.
- A chunk length of 0 along a dimension that is not empty, in a v3
regularchunk grid. zarr-python 3.0 and 3.1 wrote it for an explicit chunk length of 0. - A chunk length of
trueorfalsein a v3regularchunk grid. Some releases of zarr-python from 3.0 to 3.2 wrotetrueforchunks=True. Some releases of 3.0 and 3.1 wrotefalseforchunks=False.