Skip to content

Commit 5908d4e

Browse files
authored
Merge pull request #32 from fractal-analytics-platform/29-deprecate-support-for-213-fractal-server
Enable >=0.2.3 ngio
2 parents 9b0a498 + 9f1b76e commit 5908d4e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ authors = [
2727
# Required Python version and dependencies
2828
requires-python = ">=3.11"
2929
dependencies = [
30-
"ngio==0.2.2",
30+
"ngio>=0.2.3, <0.3.0",
3131
"fractal-task-tools==0.0.12",
3232
]
3333

src/fractal_helper_tasks/rechunk_zarr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from typing import Any, Optional
1111

1212
import ngio
13+
import ngio.images
14+
import ngio.images.label
1315
from ngio.ome_zarr_meta import AxesMapper
1416
from pydantic import validate_call
1517

@@ -124,22 +126,21 @@ def rechunk_zarr(
124126
axes_mapper=old_label.meta.axes_mapper,
125127
chunk_sizes=chunk_sizes,
126128
)
127-
ngio.images.label._derive_label(
129+
new_label = new_ome_zarr_container.derive_label(
128130
name=label,
129-
store=f"{rechunked_zarr_url}/labels/{label}",
130131
ref_image=old_label,
131132
chunks=new_chunksize,
132133
overwrite=overwrite,
133134
)
134135
if rebuild_pyramids:
135-
new_label = new_ome_zarr_container.get_label(name=label)
136136
new_label.set_array(old_label.get_array(mode="dask"))
137137
new_label.consolidate()
138138
else:
139139
label_pyramid_paths = old_label.meta.paths
140140
for path in label_pyramid_paths:
141-
new_ome_zarr_container.get_label(name=label, path=path).set_array(
142-
old_label.get_array(path=path, mode="dask")
141+
old_label = ome_zarr_container.get_label(name=label, path=path)
142+
new_label.set_array(
143+
old_label.get_array(mode="dask")
143144
)
144145

145146
if overwrite_input:

0 commit comments

Comments
 (0)