From d5fef270ee2e22f8063994437c63cf3441566f09 Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Thu, 30 Apr 2020 13:30:56 +0200
Subject: [PATCH] Updated _more_tags methods

---
 bob/bio/base/transformers/algorithm.py | 5 +----
 bob/bio/base/transformers/extractor.py | 8 ++++----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/bob/bio/base/transformers/algorithm.py b/bob/bio/base/transformers/algorithm.py
index 1fe164d0..f49b906c 100644
--- a/bob/bio/base/transformers/algorithm.py
+++ b/bob/bio/base/transformers/algorithm.py
@@ -75,7 +75,4 @@ class AlgorithmTransformer(TransformerMixin, BaseEstimator):
             ]
 
     def _more_tags(self):
-        if self.callable.requires_training:
-            return {"stateless": False, "requires_fit": True}
-        else:
-            return {"stateless": True, "requires_fit": False}
+        return {"stateless": not self.callable.requires_training, "requires_fit": self.callable.requires_training}
diff --git a/bob/bio/base/transformers/extractor.py b/bob/bio/base/transformers/extractor.py
index e2ddcb32..40778e77 100644
--- a/bob/bio/base/transformers/extractor.py
+++ b/bob/bio/base/transformers/extractor.py
@@ -58,7 +58,7 @@ class ExtractorTransformer(TransformerMixin, BaseEstimator):
             ]
 
     def _more_tags(self):
-        if self.callable.requires_training:
-            return {"stateless": False, "requires_fit": True}
-        else:
-            return {"stateless": True, "requires_fit": False}
+        return {
+            "stateless": not self.callable.requires_training,
+            "requires_fit": self.callable.requires_training,
+        }
-- 
GitLab