From 1c92af30af55a34cbcb54dc993d6e762324176e6 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 Mar 2024 22:22:56 -0500 Subject: [PATCH] BUG: Detect .ome.zarr as supported by NGFF_ZARR --- ngff_zarr/detect_cli_io_backend.py | 2 +- test/test_detect_cli_input_backend.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ngff_zarr/detect_cli_io_backend.py b/ngff_zarr/detect_cli_io_backend.py index 78cee7b..e72f1ea 100644 --- a/ngff_zarr/detect_cli_io_backend.py +++ b/ngff_zarr/detect_cli_io_backend.py @@ -21,7 +21,7 @@ def detect_cli_io_backend(input: List[str]) -> ConversionBackend: extension = "".join(Path(input[0]).suffixes).lower() - ngff_zarr_supported_extensions = (".zarr",) + ngff_zarr_supported_extensions = (".zarr", ".ome.zarr") if extension in ngff_zarr_supported_extensions: return ConversionBackend.NGFF_ZARR diff --git a/test/test_detect_cli_input_backend.py b/test/test_detect_cli_input_backend.py index 75e2c97..a4440f8 100644 --- a/test/test_detect_cli_input_backend.py +++ b/test/test_detect_cli_input_backend.py @@ -1,6 +1,16 @@ from ngff_zarr import ConversionBackend, detect_cli_io_backend +def test_detect_ngff_zarr_input_backend(): + extension = ".ome.zarr" + backend = detect_cli_io_backend( + [ + f"file{extension}", + ] + ) + assert backend == ConversionBackend.NGFF_ZARR + + def test_detect_itk_input_backend(): extension = ".nrrd" backend = detect_cli_io_backend(