Skip to content

Commit ac6ae73

Browse files
committed
add new conversion as options for v04 metadata
fix version conversion for 0.4 metadata
1 parent c0d6570 commit ac6ae73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ome_zarr_models/v04/multiscales.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from collections.abc import Sequence
3737

3838
from ome_zarr_models.v05.multiscales import Multiscale as MultiscaleV05
39+
from ome_zarr_models._v06.multiscales import Multiscale as MultiscaleV06
3940

4041

4142
__all__ = ["Dataset", "Multiscale"]
@@ -57,15 +58,20 @@ class Multiscale(BaseAttrs):
5758
type: JsonValue = None
5859
version: Literal["0.4"] | None = None
5960

60-
def to_version(self, version: Literal["0.5"]) -> MultiscaleV05:
61+
def to_version(
62+
self, version: Literal["0.5", "0.6"], **kwargs: Any
63+
) -> MultiscaleV05 | MultiscaleV06:
6164
"""
6265
Convert this Multiscale metadata to the specified version.
6366
6467
Currently supports conversions:
6568
- from 0.4 to 0.5
69+
- from 0.4 to 0.6
6670
"""
6771
if version == "0.5":
6872
return self._to_v05()
73+
elif version == "0.6":
74+
return self._to_v05()._to_v06(**kwargs)
6975
else:
7076
raise ValueError(f"Unsupported version conversion: 0.4 -> {version}")
7177

0 commit comments

Comments
 (0)