|
25 | 25 | ) |
26 | 26 | from rich.spinner import Spinner |
27 | 27 | from rich_argparse import RichHelpFormatter |
28 | | -from zarr.storage import DirectoryStore |
| 28 | +import zarr.storage |
| 29 | + |
| 30 | +if hasattr(zarr.storage, "DirectoryStore"): |
| 31 | + LocalStore = zarr.storage.DirectoryStore |
| 32 | +else: |
| 33 | + LocalStore = zarr.storage.LocalStore |
29 | 34 |
|
30 | 35 | from .cli_input_to_ngff_image import cli_input_to_ngff_image |
31 | 36 | from .config import config |
@@ -236,7 +241,7 @@ def main(): |
236 | 241 | cache_dir = Path(args.cache_dir).resolve() |
237 | 242 | if not cache_dir.exists(): |
238 | 243 | Path.makedirs(cache_dir, parents=True) |
239 | | - config.cache_store = zarr.storage.DirectoryStore(cache_dir, **zarr_kwargs) |
| 244 | + config.cache_store = LocalStore(cache_dir, **zarr_kwargs) |
240 | 245 |
|
241 | 246 | console = Console() |
242 | 247 | progress = RichProgress( |
@@ -303,7 +308,7 @@ def shutdown_client(sig_id, frame): # noqa: ARG001 |
303 | 308 | ) |
304 | 309 | output_store = None |
305 | 310 | if args.output and output_backend is ConversionBackend.NGFF_ZARR: |
306 | | - output_store = DirectoryStore(args.output, **zarr_kwargs) |
| 311 | + output_store = LocalStore(args.output, **zarr_kwargs) |
307 | 312 |
|
308 | 313 | subtitle = "[red]generation" |
309 | 314 | if not args.output: |
@@ -332,7 +337,7 @@ def shutdown_client(sig_id, frame): # noqa: ARG001 |
332 | 337 | return |
333 | 338 |
|
334 | 339 | if input_backend is ConversionBackend.NGFF_ZARR: |
335 | | - store = zarr.storage.DirectoryStore(args.input[0]) |
| 340 | + store = LocalStore(args.input[0]) |
336 | 341 | multiscales = from_ngff_zarr(store) |
337 | 342 | _multiscales_to_ngff_zarr( |
338 | 343 | live, args, output_store, rich_dask_progress, multiscales |
|
0 commit comments