Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fepegar committed Feb 19, 2024
1 parent f0242ee commit d862532
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/torchio/data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def _parse_affine(affine: Optional[TypeData]) -> np.ndarray:
return affine.astype(np.float64)

@staticmethod
def _is_paths_sequence(path: Union[TypePath, Sequence[TypePath]]) -> bool:
def _is_paths_sequence(path: Union[TypePath, Sequence[TypePath], None]) -> bool:
is_not_string = not isinstance(path, str)
return is_not_string and is_iterable(path)

Expand All @@ -530,6 +530,7 @@ def _is_dir(self) -> bool:
elif self.path is None:
return False
else:
assert isinstance(self.path, Path)
return self.path.is_dir()

def load(self) -> None:
Expand Down

0 comments on commit d862532

Please sign in to comment.