Skip to content

Commit

Permalink
Better handling of file paths in diffread
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Nov 12, 2020
1 parent 9c5dd19 commit 9761c46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skued/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def diffread(fname):
skimage.io.imread : load images from files
skued.mibread : Read single- and multi-image Merlin Image Binary files
"""
fname = str(fname) # In case of pathlib.Path
fname = Path(fname)

if fname.endswith(".mib"):
if fname.suffix == ".mib":
return mibread(fname)
elif fname.endswith((".dm3", ".dm4")):
elif fname.suffix in {".dm3", ".dm4"}:
return dmread(fname)

# Worst-case scenario, we need skimage.io
Expand Down

0 comments on commit 9761c46

Please sign in to comment.