From 6f288bf68252b11b730b8f7feb18cf420e096291 Mon Sep 17 00:00:00 2001 From: Manuel Gunther <siebenkopf@googlemail.com> Date: Thu, 23 Feb 2017 15:31:33 -0700 Subject: [PATCH] Use super in base class constructor calls --- bob/bio/base/algorithm/BIC.py | 3 +-- bob/bio/base/algorithm/Distance.py | 3 +-- bob/bio/base/algorithm/LDA.py | 3 +-- bob/bio/base/algorithm/PCA.py | 3 +-- bob/bio/base/algorithm/PLDA.py | 5 ++--- bob/bio/base/extractor/Linearize.py | 2 +- bob/bio/base/preprocessor/Filename.py | 2 +- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/bob/bio/base/algorithm/BIC.py b/bob/bio/base/algorithm/BIC.py index 2348e5cd..c15b5e58 100644 --- a/bob/bio/base/algorithm/BIC.py +++ b/bob/bio/base/algorithm/BIC.py @@ -73,8 +73,7 @@ class BIC(Algorithm): ): # call base class function and register that this tool requires training for the enrollment - Algorithm.__init__( - self, + super(BIC, self).__init__( requires_enroller_training=True, comparison_function=str(comparison_function), diff --git a/bob/bio/base/algorithm/Distance.py b/bob/bio/base/algorithm/Distance.py index efde5502..f902dcd2 100644 --- a/bob/bio/base/algorithm/Distance.py +++ b/bob/bio/base/algorithm/Distance.py @@ -37,8 +37,7 @@ class Distance (Algorithm): ): # call base class constructor and register that the algorithm performs a projection - Algorithm.__init__( - self, + super(Distance, self).__init__( distance_function = str(distance_function), is_distance_function = is_distance_function, diff --git a/bob/bio/base/algorithm/LDA.py b/bob/bio/base/algorithm/LDA.py index 745092d0..b0cb34b9 100644 --- a/bob/bio/base/algorithm/LDA.py +++ b/bob/bio/base/algorithm/LDA.py @@ -65,8 +65,7 @@ class LDA (Algorithm): ): # call base class constructor and register that the LDA tool performs projection and need the training features split by client - Algorithm.__init__( - self, + super(LDA, self).__init__( performs_projection = True, split_training_features_by_client = True, diff --git a/bob/bio/base/algorithm/PCA.py b/bob/bio/base/algorithm/PCA.py index ce6d6ee2..d62faf5c 100644 --- a/bob/bio/base/algorithm/PCA.py +++ b/bob/bio/base/algorithm/PCA.py @@ -49,8 +49,7 @@ class PCA (Algorithm): ): # call base class constructor and register that the algorithm performs a projection - Algorithm.__init__( - self, + super(PCA, self).__init__( performs_projection = True, subspace_dimension = subspace_dimension, diff --git a/bob/bio/base/algorithm/PLDA.py b/bob/bio/base/algorithm/PLDA.py index a82c8298..e2350d6b 100644 --- a/bob/bio/base/algorithm/PLDA.py +++ b/bob/bio/base/algorithm/PLDA.py @@ -37,8 +37,7 @@ class PLDA (Algorithm): """Initializes the local (PCA-)PLDA tool chain with the given file selector object""" # call base class constructor and register that this class requires training for enrollment - Algorithm.__init__( - self, + super(PLDA, self).__init__( requires_enroller_training = True, subspace_dimension_of_f = subspace_dimension_of_f, # Size of subspace F @@ -113,7 +112,7 @@ class PLDA (Algorithm): """Generates the PLDA base model from a list of arrays (one per identity), and a set of training parameters. If PCA is requested, it is trained on the same data. Both the trained PLDABase and the PCA machine are written.""" - + # arrange PLDA training data training_features = self._arrange_data(training_features) diff --git a/bob/bio/base/extractor/Linearize.py b/bob/bio/base/extractor/Linearize.py index e69de5d1..27c5ea23 100644 --- a/bob/bio/base/extractor/Linearize.py +++ b/bob/bio/base/extractor/Linearize.py @@ -15,7 +15,7 @@ class Linearize(Extractor): def __init__(self, dtype=None): """If the ``dtype`` parameter is given, it specifies the data type that is enforced for the features.""" - Extractor.__init__(self, dtype=dtype) + super(Linearize, self).__init__(dtype=dtype) self.dtype = dtype def __call__(self, data): diff --git a/bob/bio/base/preprocessor/Filename.py b/bob/bio/base/preprocessor/Filename.py index 4c0fddd5..52429c1c 100644 --- a/bob/bio/base/preprocessor/Filename.py +++ b/bob/bio/base/preprocessor/Filename.py @@ -15,7 +15,7 @@ class Filename (Preprocessor): def __init__(self): # call base class constructor, using a custom ``read_original_data`` that does nothing and always returns None - Preprocessor.__init__(self, writes_data=False, read_original_data = lambda x,y,z: None) + super(Filename, self).__init__(writes_data=False, read_original_data = lambda x,y,z: None) # The call function (i.e. the operator() in C++ terms) -- GitLab