Skip to content

Commit 861155a

Browse files
committed
Skip empty folders when parsing multiple folders
1 parent 92fcf8a commit 861155a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/spatialdata_io/readers/macsima.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ def macsima(
318318
for p in path.iterdir()
319319
if p.is_dir() and (not filter_folder_names or not any(f in p.name for f in filter_folder_names))
320320
]:
321+
if not len(list(p.glob("*.tif*"))):
322+
warnings.warn(f"No tif files found in {p}, skipping it!", UserWarning, stacklevel=2)
323+
continue
321324
sdatas[p.stem] = parse_processed_folder(
322325
path=p,
323326
imread_kwargs=imread_kwargs,

0 commit comments

Comments
 (0)