From 88b1e2a6d0b00a7bb8ff048b3624131ad820fe03 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 7 Oct 2019 14:02:13 +0200 Subject: [PATCH 1/2] Fix Type Checks --- delira/data_loading/data_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/delira/data_loading/data_manager.py b/delira/data_loading/data_manager.py index 182e8e37..90ff5761 100644 --- a/delira/data_loading/data_manager.py +++ b/delira/data_loading/data_manager.py @@ -93,8 +93,8 @@ class defining the sampling strategy self.data = data - if not inspect.isclass(sampler_cls) and issubclass(sampler_cls, - AbstractSampler): + if not (inspect.isclass(sampler_cls) and issubclass(sampler_cls, + AbstractSampler)): raise TypeError self.sampler_cls = sampler_cls @@ -302,8 +302,8 @@ def transforms(self, new_transforms): """ - if new_transforms is not None or isinstance(new_transforms, - AbstractTransform): + if new_transforms is not None and not isinstance( + new_transforms, AbstractTransform): raise TypeError self._transforms = new_transforms From 90bd4603c4dad121fae9c7b4d981bff8d62ad13c Mon Sep 17 00:00:00 2001 From: Travis AutoPEP8 Fixes Date: Mon, 7 Oct 2019 13:08:35 +0000 Subject: [PATCH 2/2] PEP-8 Auto-Fix --- delira/data_loading/data_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delira/data_loading/data_manager.py b/delira/data_loading/data_manager.py index 90ff5761..65fd7c51 100644 --- a/delira/data_loading/data_manager.py +++ b/delira/data_loading/data_manager.py @@ -94,7 +94,7 @@ class defining the sampling strategy self.data = data if not (inspect.isclass(sampler_cls) and issubclass(sampler_cls, - AbstractSampler)): + AbstractSampler)): raise TypeError self.sampler_cls = sampler_cls @@ -303,7 +303,7 @@ def transforms(self, new_transforms): """ if new_transforms is not None and not isinstance( - new_transforms, AbstractTransform): + new_transforms, AbstractTransform): raise TypeError self._transforms = new_transforms