diff --git a/batchflow/batch.py b/batchflow/batch.py index 378afae12..18131a419 100755 --- a/batchflow/batch.py +++ b/batchflow/batch.py @@ -90,7 +90,7 @@ class Batch(metaclass=MethodsTransformingMeta): def __init__(self, index, dataset=None, pipeline=None, preloaded=None, copy=False, *args, **kwargs): _ = args - if self.components is not None and not isinstance(self.components, tuple): + if self.components is not None and not isinstance(self.components, tuple): raise TypeError("components should be a tuple of strings with components names") self.index = index self._preloaded_lock = threading.Lock() diff --git a/batchflow/batch_image.py b/batchflow/batch_image.py index 1878a5746..0339464ae 100644 --- a/batchflow/batch_image.py +++ b/batchflow/batch_image.py @@ -49,8 +49,9 @@ def _make_path(self, ix, src=None): path : str Full path to an element. """ - - if isinstance(src, FilesIndex): + if src is None: + path = str(ix) + elif isinstance(src, FilesIndex): path = src.get_fullpath(ix) elif isinstance(self.index, FilesIndex): path = self.index.get_fullpath(ix)