Spec change process¶
How to propose a change to the Zarr Vectors format, what the change must update in this repository, and the template every spec page follows.
Terms¶
- Format change
A change to what a store contains or means: a key in the root, level or array attributes, an array’s layout or cell encoding, a geometry type, or a validation rule.
- RFC
A GitHub issue titled with the prefix
[RFC]that proposes a format change before it is implemented.- Breaking change
A format change after which this package cannot read existing stores, or reads them with a different meaning.
- Additive change
A format change that adds something optional, such as a key or a format capability, and leaves existing stores unchanged in meaning.
Introduction¶
A format change is agreed in an RFC before code is written, so existing stores do not change meaning without notice. Other changes go straight to a pull request. If unsure, open an issue and ask.
Technical reference¶
When an RFC is needed¶
RFC needed |
No RFC needed |
|---|---|
Adding, renaming or removing a root, level or array attribute key |
Fixes that leave the format unchanged |
Changing an array’s data type, shape, cell encoding or meaning |
New ingest or export formats |
Adding a geometry type (see Adding a geometry type) |
New API functions |
Adding or changing a validation rule, or anything that changes the validator’s result on an existing store |
Performance work that leaves the stored bytes unchanged |
Changing the |
Documentation |
Process¶
Open an issue in the
zarr-vectors-pyrepository titled[RFC] ..., with the sections Motivation, Proposed change (with example JSON or pseudocode), Compatibility (are existing stores still readable?) and Alternatives considered.Discuss. The issue stays open for at least 14 days for an additive change, 30 days for a breaking change.
Accept. Two maintainers approve in the issue, and it is labelled
accepted.Implement in a pull request that links the RFC and holds no unrelated changes.
Merge after two maintainer approvals and a passing test workflow. For an author who is not a repository owner, member or collaborator, the workflow runs only after a maintainer adds the
ci-approvedlabel.
The implementation pull request updates:
the code under
zarr_vectors/;FORMAT_VERSIONinzarr_vectors/constants.py(written tozv_versionin the root attributes), with a note in its docstring, and the test that pins it (test_format_version_is_0_10_0intests/test_linkml_schema.py). The docstring is the format history; there is no changelog file;the validator in
zarr_vectors/validate/, when a rule changes;when the metadata changes, the LinkML model in
convention/of AllenInstitute/zarr_vectors; copy it toschema/and runpython schema/regen.py(see Machine-readable schema);tests (see Compliance testing);
the affected pages under
docs/spec/.
Versions¶
FORMAT_VERSION is MAJOR.MINOR.PATCH. While the format is 0.x, a
breaking change increments the minor component (0.8.x to 0.9.0) and an
additive change the patch component (0.9.1 added attribute_specs,
0.9.2 the ome node). The release workflow refuses a release whose tag
differs from FORMAT_VERSION.
Breaking changes and capabilities¶
RootMetadata.validate (zarr_vectors/core/metadata.py) raises
MetadataError for a store whose zv_version is older than 0.10.0,
the oldest layout this package reads, and reading a 0.9.x root raises
UnsupportedFormatVersionError. A breaking change moves that bound and
its RFC must say how users rewrite their stores. When only metadata
moves, ship an in-place migration, as
zarr_vectors.building.migrate_metadata_0_10 does for 0.9.x stores (see
Root metadata). An
additive change should offer an in-place upgrade where it can, as
zarr_vectors.building.stamp_ome_node adds the 0.9.2 ome node without
rewriting data.
A change to the metadata layout also changes the Zarr Vectors convention, which lists the format versions each convention version covers.
A change that only some readers can handle can be a format capability
instead. The store lists it in format_capabilities, and also in
required_capabilities when a reader without it must refuse the store.
See Root metadata.
Spec documentation standards¶
Every page in docs/spec/ has three parts, in this order:
Terms: defines each term the page uses.
Introduction: what this part of the format is for, for a Python developer new to Zarr Vectors.
Technical reference: JSON examples, rules and worked examples, ending in a Validation subsection that lists the checks and their level, checked against
zarr_vectors/validate/.
Pages use relative links and run every code example against the package.