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

Skip to content

Commit f336729

Browse files
committed
Remove mlab.log2
1 parent 22fe034 commit f336729

3 files changed

Lines changed: 2 additions & 20 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ in Matplotlib 2.2 has been removed. See below for a list:
1414
- `mlab.frange` (use numpy.arange instead)
1515
- `mlab.identity` (use numpy.identity instead)
1616
- `mlab.base_repr`
17+
- `mlab.log2` (use numpy.log2 instead)
1718
- `mlab.cohere_pairs` (use scipy.signal.coherence instead)
1819
- `mlab.entropy` (use scipy.stats.entropy instead)
1920
- `mlab.normpdf` (use scipy.stats.norm.pdf instead)

lib/matplotlib/mlab.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,25 +1270,6 @@ def binary_repr(number, max_length=1025):
12701270
return ''.join(map(repr, digits)).replace('L', '')
12711271

12721272

1273-
@cbook.deprecated("2.2", 'numpy.log2')
1274-
def log2(x, ln2=math.log(2.0)):
1275-
"""
1276-
Return the log(*x*) in base 2.
1277-
1278-
This is a _slow_ function but which is guaranteed to return the correct
1279-
integer value if the input is an integer exact power of 2.
1280-
"""
1281-
try:
1282-
bin_n = binary_repr(x)[1:]
1283-
except (AssertionError, TypeError):
1284-
return math.log(x)/ln2
1285-
else:
1286-
if '1' in bin_n:
1287-
return math.log(x)/ln2
1288-
else:
1289-
return len(bin_n)
1290-
1291-
12921273
@cbook.deprecated("2.2")
12931274
def ispower2(n):
12941275
"""

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
binary_repr, csv2rec,
233233
demean, detrend, detrend_linear, detrend_mean, detrend_none,
234234
ispower2, isvector,
235-
log2, movavg,
235+
movavg,
236236
window_hanning, window_none)
237237

238238
from matplotlib import cbook, mlab, pyplot as plt

0 commit comments

Comments
 (0)