Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ecc0912

Browse files
committed
Add some mlab alternatives
1 parent 9b48fd8 commit ecc0912

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

lib/matplotlib/mlab.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
long = int
187187

188188

189-
@cbook.deprecated("2.2", alternative='np.logspace, np.geomspace')
189+
@cbook.deprecated("2.2", alternative='numpy.logspace or numpy.geomspace')
190190
def logspace(xmin, xmax, N):
191191
'''
192192
Return N values logarithmically spaced between xmin and xmax.
@@ -1346,7 +1346,7 @@ def donothing_callback(*args):
13461346
pass
13471347

13481348

1349-
@cbook.deprecated('2.2')
1349+
@cbook.deprecated('2.2', 'scipy.signal.coherence')
13501350
def cohere_pairs(X, ij, NFFT=256, Fs=2, detrend=detrend_none,
13511351
window=window_hanning, noverlap=0,
13521352
preferSpeedOverMemory=True,
@@ -1504,7 +1504,7 @@ def cohere_pairs(X, ij, NFFT=256, Fs=2, detrend=detrend_none,
15041504
return Cxy, Phase, freqs
15051505

15061506

1507-
@cbook.deprecated('2.2')
1507+
@cbook.deprecated('2.2', 'scipy.stats.entropy')
15081508
def entropy(y, bins):
15091509
r"""
15101510
Return the entropy of the data in *y* in units of nat.
@@ -1534,7 +1534,7 @@ def entropy(y, bins):
15341534
return S
15351535

15361536

1537-
@cbook.deprecated('2.2')
1537+
@cbook.deprecated('2.2', 'scipy.stats.norm.pdf')
15381538
def normpdf(x, *args):
15391539
"Return the normal pdf evaluated at *x*; args provides *mu*, *sigma*"
15401540
mu, sigma = args
@@ -1718,7 +1718,7 @@ def _get_colinear():
17181718
return a
17191719

17201720

1721-
@cbook.deprecated('2.2')
1721+
@cbook.deprecated('2.2', 'numpy.percentile')
17221722
def prctile(x, p=(0.0, 25.0, 50.0, 75.0, 100.0)):
17231723
"""
17241724
Return the percentiles of *x*. *p* can either be a sequence of
@@ -1801,7 +1801,7 @@ def center_matrix(M, dim=0):
18011801
return M
18021802

18031803

1804-
@cbook.deprecated('2.2')
1804+
@cbook.deprecated('2.2', 'scipy.integrate.ode')
18051805
def rk4(derivs, y0, t):
18061806
"""
18071807
Integrate 1D or ND system of ODEs using 4-th order Runge-Kutta.
@@ -1919,7 +1919,7 @@ def get_sparse_matrix(M, N, frac=0.1):
19191919
return data
19201920

19211921

1922-
@cbook.deprecated('2.2')
1922+
@cbook.deprecated('2.2', 'numpy.hypot')
19231923
def dist(x, y):
19241924
"""
19251925
Return the distance between two points.
@@ -2061,7 +2061,7 @@ def movavg(x, n):
20612061
exp_safe_MAX = 1.7976931348623157e+308
20622062

20632063

2064-
@cbook.deprecated("2.2")
2064+
@cbook.deprecated("2.2", 'numpy.exp')
20652065
def exp_safe(x):
20662066
"""
20672067
Compute exponentials which safely underflow to zero.
@@ -2077,7 +2077,7 @@ def exp_safe(x):
20772077
return math.exp(x)
20782078

20792079

2080-
@cbook.deprecated("2.2", alternative='np.array(list(map(...)))')
2080+
@cbook.deprecated("2.2", alternative='numpy.array(list(map(...)))')
20812081
def amap(fn, *args):
20822082
"""
20832083
amap(function, sequence[, sequence, ...]) -> array.
@@ -2096,7 +2096,7 @@ def rms_flat(a):
20962096
return np.sqrt(np.mean(np.abs(a) ** 2))
20972097

20982098

2099-
@cbook.deprecated("2.2", alternative='np.linalg.norm(a, ord=1)')
2099+
@cbook.deprecated("2.2", alternative='numpy.linalg.norm(a, ord=1)')
21002100
def l1norm(a):
21012101
"""
21022102
Return the *l1* norm of *a*, flattened out.
@@ -2106,7 +2106,7 @@ def l1norm(a):
21062106
return np.sum(np.abs(a))
21072107

21082108

2109-
@cbook.deprecated("2.2", alternative='np.linalg.norm(a, ord=2)')
2109+
@cbook.deprecated("2.2", alternative='numpy.linalg.norm(a, ord=2)')
21102110
def l2norm(a):
21112111
"""
21122112
Return the *l2* norm of *a*, flattened out.
@@ -2116,7 +2116,7 @@ def l2norm(a):
21162116
return np.sqrt(np.sum(np.abs(a) ** 2))
21172117

21182118

2119-
@cbook.deprecated("2.2", alternative='np.linalg.norm(a.flat, ord=p)')
2119+
@cbook.deprecated("2.2", alternative='numpy.linalg.norm(a.flat, ord=p)')
21202120
def norm_flat(a, p=2):
21212121
"""
21222122
norm(a,p=2) -> l-p norm of a.flat
@@ -2134,7 +2134,7 @@ def norm_flat(a, p=2):
21342134
return np.sum(np.abs(a) ** p) ** (1 / p)
21352135

21362136

2137-
@cbook.deprecated("2.2")
2137+
@cbook.deprecated("2.2", 'numpy.arange')
21382138
def frange(xini, xfin=None, delta=None, **kw):
21392139
"""
21402140
frange([start,] stop[, step, keywords]) -> array of floats
@@ -2202,7 +2202,7 @@ def frange(xini, xfin=None, delta=None, **kw):
22022202
# end frange()
22032203

22042204

2205-
@cbook.deprecated("2.2")
2205+
@cbook.deprecated("2.2", 'numpy.identity')
22062206
def identity(n, rank=2, dtype='l', typecode=None):
22072207
"""
22082208
Returns the identity matrix of shape (*n*, *n*, ..., *n*) (rank *r*).
@@ -2268,7 +2268,7 @@ def binary_repr(number, max_length=1025):
22682268
return ''.join(map(repr, digits)).replace('L', '')
22692269

22702270

2271-
@cbook.deprecated("2.2")
2271+
@cbook.deprecated("2.2", 'numpy.log2')
22722272
def log2(x, ln2=math.log(2.0)):
22732273
"""
22742274
Return the log(*x*) in base 2.
@@ -2287,7 +2287,7 @@ def log2(x, ln2=math.log(2.0)):
22872287
return len(bin_n)
22882288

22892289

2290-
@cbook.deprecated("2.2")
2290+
@cbook.deprecated("2.2", 'numpy.mod(n, 2)')
22912291
def ispower2(n):
22922292
"""
22932293
Returns the log base 2 of *n* if *n* is a power of 2, zero otherwise.
@@ -2319,7 +2319,7 @@ def isvector(X):
23192319

23202320

23212321
# helpers for loading, saving, manipulating and viewing numpy record arrays
2322-
@cbook.deprecated("2.2")
2322+
@cbook.deprecated("2.2", 'numpy.isnan')
23232323
def safe_isnan(x):
23242324
':func:`numpy.isnan` for arbitrary types'
23252325
if isinstance(x, six.string_types):
@@ -2334,7 +2334,7 @@ def safe_isnan(x):
23342334
return b
23352335

23362336

2337-
@cbook.deprecated("2.2")
2337+
@cbook.deprecated("2.2", 'numpy.isinf')
23382338
def safe_isinf(x):
23392339
':func:`numpy.isinf` for arbitrary types'
23402340
if isinstance(x, six.string_types):
@@ -3130,7 +3130,7 @@ def csvformat_factory(format):
31303130
return format
31313131

31323132

3133-
@cbook.deprecated("2.2", alternative='np.recarray.tofile')
3133+
@cbook.deprecated("2.2", alternative='numpy.recarray.tofile')
31343134
def rec2txt(r, header=None, padding=3, precision=3, fields=None):
31353135
"""
31363136
Returns a textual representation of a record array.
@@ -3251,7 +3251,7 @@ def format(item, just_pad_prec_spacer):
32513251
return text
32523252

32533253

3254-
@cbook.deprecated("2.2", alternative='np.recarray.tofile')
3254+
@cbook.deprecated("2.2", alternative='numpy.recarray.tofile')
32553255
def rec2csv(r, fname, delimiter=',', formatd=None, missing='',
32563256
missingd=None, withheader=True):
32573257
"""
@@ -3452,7 +3452,7 @@ def griddata(x, y, z, xi, yi, interp='nn'):
34523452
##################################################
34533453
# Linear interpolation algorithms
34543454
##################################################
3455-
@cbook.deprecated("2.2", alternative="np.interp")
3455+
@cbook.deprecated("2.2", alternative="numpy.interp")
34563456
def less_simple_linear_interpolation(x, y, xi, extrap=False):
34573457
"""
34583458
This function provides simple (but somewhat less so than

0 commit comments

Comments
 (0)