Skip to content

Commit

Permalink
refactor(images): add directory check
Browse files Browse the repository at this point in the history
  • Loading branch information
yzx9 committed Apr 5, 2024
1 parent c6b042f commit a8007ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swcgeom/images/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def _read(self, fname: str) -> npt.NDArray[ScalarType]:

@staticmethod
def scan(root: str, *, pattern: Optional[str] = None) -> List[str]:
if not os.path.isdir(root):
raise NotADirectoryError(f"not a directory: {root}")

is_valid = re.compile(pattern).match if pattern is not None else truthly

fs = []
Expand Down

0 comments on commit a8007ac

Please sign in to comment.