Skip to content

Commit 8d88d0a

Browse files
committed
Separating supported extensions from #482
1 parent 6ca6404 commit 8d88d0a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/tiledb/cloud/bioimg/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from tiledb.cloud.bioimg.exportation import export
22
from tiledb.cloud.bioimg.ingestion import ingest
33

4-
__all__ = ("ingest", "export")
4+
from .types import SupportedExtensions
5+
6+
__all__ = ("ingest", "export", "SupportedExtensions")

src/tiledb/cloud/bioimg/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import tiledb
66

7+
from .types import SupportedExtensions
8+
79

810
def get_uris(
911
source: Sequence[str], output_dir: str, config: Mapping[str, Any], output_ext: str
@@ -21,7 +23,7 @@ def create_output_path(input_file, output_dir) -> str:
2123

2224
def iter_paths(sequence) -> Iterator[Tuple]:
2325
for uri in sequence:
24-
if uri.endswith((".tiff", ".tif", ".tdb")):
26+
if uri.endswith(tuple([ext.value for ext in SupportedExtensions])):
2527
yield uri, create_output_path(uri, output_dir)
2628

2729
if len(source) == 1 and vfs.is_dir(source[0]):

src/tiledb/cloud/bioimg/types.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import enum
2+
3+
class SupportedExtensions(enum.Enum):
4+
TIFF: str = ".tiff"
5+
TIF: str = ".tif"
6+
SVS: str = ".svs"
7+
TDB: str = ".tdb"

0 commit comments

Comments
 (0)