2
2
import scipy .sparse as sp
3
3
import warnings
4
4
5
+
5
6
def assert_all_finite (X ):
6
7
"""Throw a ValueError if X contains NaN or infinity.
7
8
Input MUST be an np.ndarray instance or a scipy.sparse matrix."""
@@ -22,12 +23,11 @@ def safe_asanyarray(X, dtype=None, order=None):
22
23
23
24
24
25
def as_float_array (X , overwrite_X = False ):
25
- """
26
- Converts a numpy array to type np.float
26
+ """Converts a numpy array to an array of floats
27
27
28
- The new dtype will be float32 or np.float64, depending on the original type.
29
- The function can create a copy or modify the argument depending
30
- of the argument overwrite_X
28
+ The new dtype will be np. float32 or np.float64, depending on the original
29
+ type. The function can create a copy or modify the argument depending
30
+ on the argument overwrite_X.
31
31
32
32
WARNING : If X is not of type float, then a copy of X with the right type
33
33
will be returned
@@ -198,6 +198,7 @@ def _decorate_class(self, cls):
198
198
199
199
# FIXME: we should probably reset __new__ for full generality
200
200
init = cls .__init__
201
+
201
202
def wrapped (* args , ** kwargs ):
202
203
warnings .warn (msg , category = DeprecationWarning )
203
204
return init (* args , ** kwargs )
0 commit comments