@@ -46,12 +46,13 @@ def __init__(self, fct, fct_inv=None):
4646 BaseReciprocalTransformer .__init__ (self )
4747 if isinstance (fct , str ):
4848 if fct_inv is not None :
49- raise ValueError (
49+ raise ValueError ( # pragma: no cover
5050 "If fct is a function name, fct_inv must not be specified." )
5151 opts = self .__class__ .available_fcts ()
5252 if fct not in opts :
53- raise ValueError ("Unknown fct '{}', it should in {}." .format (
54- fct , list (sorted (opts ))))
53+ raise ValueError ( # pragma: no cover
54+ "Unknown fct '{}', it should in {}." .format (
55+ fct , list (sorted (opts ))))
5556 else :
5657 if fct_inv is None :
5758 raise ValueError (
@@ -117,7 +118,8 @@ def fit(self, X=None, y=None, sample_weight=None):
117118 Defines a random permutation over the targets.
118119 """
119120 if y is None :
120- raise RuntimeError ("targets cannot be empty." )
121+ raise RuntimeError ( # pragma: no cover
122+ "targets cannot be empty." )
121123 num = numpy .issubdtype (y .dtype , numpy .floating )
122124 perm = {}
123125 for u in y .ravel ():
@@ -141,7 +143,7 @@ def fit(self, X=None, y=None, sample_weight=None):
141143
142144 def _check_is_fitted (self ):
143145 if not hasattr (self , 'permutation_' ):
144- raise NotFittedError (
146+ raise NotFittedError ( # pragma: no cover
145147 "This instance {} is not fitted yet. Call 'fit' with "
146148 "appropriate arguments before using this method." .format (
147149 type (self )))
@@ -169,8 +171,9 @@ def _find_closest(self, cl):
169171 return float (res )
170172 if self .knn_perm_ .dtype in (numpy .int32 , numpy .int64 ):
171173 return int (res )
172- raise NotImplementedError ("The function does not work for type {}." .format (
173- self .knn_perm_ .dtype ))
174+ raise NotImplementedError ( # pragma: no cover
175+ "The function does not work for type {}." .format (
176+ self .knn_perm_ .dtype ))
174177
175178 def transform (self , X , y ):
176179 """
0 commit comments