Skip to content

Commit

Permalink
PimsWrapper: check that inizializer is a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzamuto committed Mar 3, 2021
1 parent 863a39b commit 89cc3d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zetastitcher/io/pims_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import matplotlib as mpl
mpl.use('Agg')

from pathlib import Path
from pims import ImageSequence

from zetastitcher.io.inputfile_mixin import InputFileMixin
Expand All @@ -18,10 +19,13 @@ def __init__(self, initializer=None):
if self.initializer is not None:
self.open()

def open(self, initializer=None):
def open(self, initializer: Path=None):
if initializer is not None:
self.initializer = initializer

if not self.initializer.is_dir():
raise ValueError(f'{self.initializer} must be a directory')

self.imseq = ImageSequence(str(self.initializer))
setattr(self, 'close', getattr(self.imseq, 'close'))

Expand Down

0 comments on commit 89cc3d6

Please sign in to comment.