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

Skip to content

Commit 7d03bf5

Browse files
committed
Remove mlab.longest_contiguous_ones
1 parent 0d9235f commit 7d03bf5

File tree

3 files changed

+3
-35
lines changed

3 files changed

+3
-35
lines changed

doc/api/next_api_changes/2018-09-18-DS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ in Matplotlib 2.2 has been removed. See below for a list:
99
- `mlab.entropy` (use scipy.stats.entropy instead)
1010
- `mlab.normpdf` (use scipy.stats.norm.pdf instead)
1111
- `mlab.find` (use ``np.nonzero(np.ravel(condition))`` instead)
12+
- `mlab.longest_contiguous_ones`
13+
- `mlab.longest_ones`
1214
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,40 +1194,6 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
11941194
return Cxy, f
11951195

11961196

1197-
@cbook.deprecated('2.2')
1198-
def longest_contiguous_ones(x):
1199-
"""
1200-
Return the indices of the longest stretch of contiguous ones in *x*,
1201-
assuming *x* is a vector of zeros and ones. If there are two
1202-
equally long stretches, pick the first.
1203-
"""
1204-
x = np.ravel(x)
1205-
if len(x) == 0:
1206-
return np.array([])
1207-
1208-
ind = (x == 0).nonzero()[0]
1209-
if len(ind) == 0:
1210-
return np.arange(len(x))
1211-
if len(ind) == len(x):
1212-
return np.array([])
1213-
1214-
y = np.zeros((len(x)+2,), x.dtype)
1215-
y[1:-1] = x
1216-
dif = np.diff(y)
1217-
up = (dif == 1).nonzero()[0]
1218-
dn = (dif == -1).nonzero()[0]
1219-
i = (dn-up == max(dn - up)).nonzero()[0][0]
1220-
ind = np.arange(up[i], dn[i])
1221-
1222-
return ind
1223-
1224-
1225-
@cbook.deprecated('2.2')
1226-
def longest_ones(x):
1227-
'''Alias for longest_contiguous_ones.'''
1228-
return longest_contiguous_ones(x)
1229-
1230-
12311197
@cbook.deprecated('2.2')
12321198
class PCA(object):
12331199
def __init__(self, a, standardize=True):

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
dist_point_to_segment, distances_along_curve, exp_safe,
236236
fftsurr, frange, get_sparse_matrix, get_xyz_where, griddata,
237237
identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm,
238-
l2norm, log2, longest_contiguous_ones, longest_ones, movavg, norm_flat,
238+
l2norm, log2, movavg, norm_flat,
239239
path_length, poly_below, poly_between, prctile, prctile_rank,
240240
rec2csv, rec_append_fields, rec_drop_fields, rec_join, rk4, rms_flat,
241241
segments_intersect, slopes, stineman_interp, vector_lengths,

0 commit comments

Comments
 (0)