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

Skip to content

Commit 73b63cb

Browse files
efiringdstansby
authored andcommitted
Merge pull request #9142 from tacaswell/mnt_memleak_future_numpy
MNT: future numpy only takes ints as index Deprecate logspace Deprecate frange
2 parents b722810 + bcafaf9 commit 73b63cb

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

lib/matplotlib/mlab.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
long = int
187187

188188

189+
@cbook.deprecated("2.1",
190+
alternative='np.logspace(np.log(xmin), np.log(xmax), N)')
189191
def logspace(xmin, xmax, N):
190192
'''
191193
Return N values logarithmically spaced between xmin and xmax.
@@ -2115,6 +2117,7 @@ def norm_flat(a, p=2):
21152117
return np.sum(np.abs(a) ** p) ** (1 / p)
21162118

21172119

2120+
@cbook.deprecated('2.1', alternative='np.linspace(xini, xfin, delta)')
21182121
def frange(xini, xfin=None, delta=None, **kw):
21192122
"""
21202123
frange([start,] stop[, step, keywords]) -> array of floats

lib/matplotlib/pylab.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
fliplr - flip the rows of a matrix up/down
139139
flipud - flip the columns of a matrix left/right
140140
linspace - a linear spaced vector of N values from min to max inclusive
141-
logspace - a log spaced vector of N values from min to max inclusive
142141
meshgrid - repeat x and y to make regular matrices
143142
ones - an array of ones
144143
rand - an array from the uniform distribution [0,1]
@@ -246,7 +245,7 @@
246245
amap, base_repr, binary_repr, bivariate_normal, center_matrix, csv2rec,
247246
demean, detrend, detrend_linear, detrend_mean, detrend_none, dist,
248247
dist_point_to_segment, distances_along_curve, entropy, exp_safe,
249-
fftsurr, find, frange, get_sparse_matrix, get_xyz_where, griddata,
248+
fftsurr, find, get_sparse_matrix, get_xyz_where, griddata,
250249
identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm,
251250
l2norm, log2, longest_contiguous_ones, longest_ones, movavg, norm_flat,
252251
normpdf, path_length, poly_below, poly_between, prctile, prctile_rank,

unit/memleak.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def run_memleak_test(bench, iterations, report):
2121
tracemalloc.start()
2222

23-
starti = min(50, iterations / 2)
23+
starti = min(50, iterations // 2)
2424
endi = iterations
2525

2626
malloc_arr = np.empty((endi,), dtype=np.int64)
@@ -77,6 +77,7 @@ def run_memleak_test(bench, iterations, report):
7777

7878
if not report.endswith('.pdf'):
7979
report = report + '.pdf'
80+
fig.tight_layout()
8081
fig.savefig(report, format='pdf')
8182

8283

0 commit comments

Comments
 (0)