Skip to content

Commit

Permalink
check len dask_delayed
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-gould committed Jun 25, 2024
1 parent 2aca9f1 commit 42746fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ome_zarr/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ def write_multiscale(
msg = """The 'chunks' argument is deprecated and will be removed in version 0.5.
Please use the 'storage_options' argument instead."""
warnings.warn(msg, DeprecationWarning)
is_dask = False
datasets: List[dict] = []
for path, data in enumerate(pyramid):
options = _resolve_storage_options(storage_options, path)
Expand All @@ -249,7 +248,6 @@ def write_multiscale(
chunks_opt = _retuple(chunks_opt, data.shape)

if isinstance(data, da.Array):
is_dask = True
if chunks_opt is not None:
data = da.array(data).rechunk(chunks=chunks_opt)
options["chunks"] = chunks_opt
Expand Down Expand Up @@ -283,7 +281,7 @@ def write_multiscale(
for dataset, transform in zip(datasets, coordinate_transformations):
dataset["coordinateTransformations"] = transform

if is_dask and not compute:
if len(dask_delayed) > 0 and not compute:
write_multiscales_metadata_delayed = dask.delayed(write_multiscales_metadata)
return dask_delayed + [
bind(write_multiscales_metadata_delayed, dask_delayed)(
Expand Down

0 comments on commit 42746fe

Please sign in to comment.