Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/rfc5.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ position `i` is the input axis that becomes the `i`-th output axis, and every
zero-based input axis index appears exactly once.

`ByDimension` builds a high dimensional transform from lower dimensional ones;
each `ByDimensionItem` wraps a transformation with the `input_axes` and `output_axes`
each `ByDimensionItem` wraps a transformation with the `inputAxes` and `outputAxes`
(zero-based indices into the parent's coordinate systems) it applies to, and
every output axis is produced by exactly one item.

Expand Down
4 changes: 2 additions & 2 deletions py/examples/upgrade_ome_zarr_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def demo_write_to_new_store(tmp: Path) -> None:
print(f" source version (after) : {src_after!r} (unchanged)")
print(f" new store version : {dst_after!r}")
assert src_after == "0.4", src_after
assert dst_after == "0.6.dev4", dst_after
assert dst_after == "0.6rc0", dst_after

# Confirm the upgraded store reads back with pixel data intact.
reloaded = from_ome_zarr(dst, version="0.6")
Expand Down Expand Up @@ -142,7 +142,7 @@ def demo_in_place(tmp: Path) -> None:
after_version = read_ome_version(store)
after_chunks = chunk_digests(store_root)
print(f" version (after) : {after_version!r}")
assert after_version == "0.6.dev4", after_version
assert after_version == "0.6rc0", after_version

# Prove every array chunk file is byte-for-byte identical.
assert after_chunks == before_chunks, "array chunk data changed on in-place upgrade"
Expand Down
3 changes: 2 additions & 1 deletion py/ngff_zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: MIT

from .__about__ import __version__
from ._supported_versions import SUPPORTED_VERSIONS
from ._supported_versions import SUPPORTED_VERSIONS, V06_ONDISK_VERSION
Comment thread
coderabbitai[bot] marked this conversation as resolved.
from .cli_input_to_ngff_image import cli_input_to_ngff_image
from .codecs import codec_from_name, get_available_codecs
from .compute_omero import (
Expand Down Expand Up @@ -110,6 +110,7 @@
__all__ = [
"__version__",
"SUPPORTED_VERSIONS",
"V06_ONDISK_VERSION",
"config",
# OMERO computation
"compute_omero_from_ngff_image",
Expand Down
20 changes: 19 additions & 1 deletion py/ngff_zarr/_supported_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ class NgffVersion(StrEnum):
V04 = "0.4"
V05 = "0.5"
V06 = "0.6"
#: Pre-release tags of the 0.6 spec. Both remain readable: stores written
#: while 0.6 was a draft carry the ``dev4`` tag on disk.
V06dev4 = "0.6.dev4"
LATEST = "0.6.dev4"
V06rc0 = "0.6rc0"
LATEST = "0.6rc0"


# Supported NGFF specification versions
Expand All @@ -25,4 +28,19 @@ class NgffVersion(StrEnum):
NgffVersion.V05,
NgffVersion.V06,
NgffVersion.V06dev4,
NgffVersion.V06rc0,
)

#: The ``ome.version`` string written to disk for the API version ``"0.6"``.
#: The 0.6 spec is a release candidate, so a store is tagged with the
#: pre-release the bundled ``spec/0.6`` schemas carry rather than with the bare
#: ``"0.6"`` the public ``version`` option accepts. Mirrors the TypeScript
#: port's ``V06_ONDISK_VERSION``; this constant is the one place the tag lives.
V06_ONDISK_VERSION = NgffVersion.V06rc0

#: 0.6 pre-release tags that earlier ngff-zarr releases wrote and that the
#: bundled schemas no longer accept. A store carrying one differs from a valid
#: store in that string alone; the validating reader says so and checks the
#: rest, and ``upgrade_ome_zarr`` rewrites the tag. Any other tag is checked
#: as given, so a tag from a later spec release is not passed off as this one.
V06_SUPERSEDED_TAGS = frozenset({NgffVersion.V06dev4.value})
4 changes: 2 additions & 2 deletions py/ngff_zarr/spec/0.6/schemas/_version.schema
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/_version.schema",
"$id": "https://ngff.openmicroscopy.org/0.6rc0/schemas/_version.schema",
"title": "OME-Zarr version",
"description": "OME-Zarr version.",
"type": "string",
"enum": [
"0.6.dev4"
"0.6rc0"
]
}
2 changes: 1 addition & 1 deletion py/ngff_zarr/spec/0.6/schemas/axes.schema
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/axes.schema",
"$id": "https://ngff.openmicroscopy.org/0.6rc0/schemas/axes.schema",
"title": "Axes",
"description": "OME-Zarr Axes.",
"type": "array",
Expand Down
4 changes: 2 additions & 2 deletions py/ngff_zarr/spec/0.6/schemas/bf2raw.schema
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/bf2raw.schema",
"$id": "https://ngff.openmicroscopy.org/0.6rc0/schemas/bf2raw.schema",
"title": "bioformats2raw",
"description": "OME-Zarr bioformats2raw metadata.",
"type": "object",
Expand All @@ -17,7 +17,7 @@
]
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/_version.schema"
"$ref": "https://ngff.openmicroscopy.org/0.6rc0/schemas/_version.schema"
}
},
"required": [
Expand Down
2 changes: 1 addition & 1 deletion py/ngff_zarr/spec/0.6/schemas/coordinate_systems.schema
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/coordinate_systems.schema",
"$id": "https://ngff.openmicroscopy.org/0.6rc0/schemas/coordinate_systems.schema",
"title": "Coordinate systems",
"description": "OME-Zarr coordinate system.",
"type": "array",
Expand Down
68 changes: 57 additions & 11 deletions py/ngff_zarr/spec/0.6/schemas/coordinate_transformations.schema
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/0.6.dev4/schemas/coordinate_transformations.schema",
"$id": "https://ngff.openmicroscopy.org/0.6rc0/schemas/coordinate_transformations.schema",
"title": "Coordinate Transformations",
"description": "OME-Zarr Coordinate transforms.",
"type": "array",
Expand Down Expand Up @@ -67,6 +67,9 @@
{
"$ref": "#/$defs/mapAxis"
},
{
"$ref": "#/$defs/projectAxis"
},
{
"$ref": "#/$defs/scale"
},
Expand Down Expand Up @@ -133,6 +136,51 @@
"mapAxis"
]
},
"projectAxis": {
"type": "object",
"title": "projectAxis transformation",
"description": "Add or drop axes from a coordinate vector.",
"allOf": [
{
"properties": {
"type": {
"const": "projectAxis"
},
"droppedInputs": {
"type": "array",
"minItems": 1,
"items": {
"type": "integer",
"minimum": 0,
"maximum": 4
},
"maxItems": 3,
"uniqueItems": true,
"description": "An array of integers representing the indices of the input axes to drop."
},
"createdOutputs": {
"type": "array",
"minItems": 1,
"items": {
"type": "integer",
"minimum": 0,
"maximum": 4
},
"maxItems": 3,
"uniqueItems": true,
"description": "An array of integers representing the indices where zeros are inserted in the output coordinate vector."
}
}
},
{
"anyOf": [
{"required": ["droppedInputs"]},
{"required": ["createdOutputs"]}
]
}
]

},
"scale": {
"type": "object",
"title": "Scale Transformation",
Expand Down Expand Up @@ -319,27 +367,25 @@
"transformation": {
"$ref": "#/$defs/coordinateTransformation"
},
"input_axes": {
"inputAxes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
"type": "number"
},
"description": "Zero-based axis indices into the parent byDimension transformation's input coordinate system."
"description": "Names of the input axes for this transformation."
},
"output_axes": {
"outputAxes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
"type": "number"
},
"description": "Zero-based axis indices into the parent byDimension transformation's output coordinate system."
"description": "Names of the output axes for this transformation."
}
},
"required": [
"transformation",
"input_axes",
"output_axes"
"inputAxes",
"outputAxes"
Comment thread
vboussot marked this conversation as resolved.
Comment thread
vboussot marked this conversation as resolved.
]
}
}
Expand Down
Loading
Loading