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

Skip to content

Commit 76864f0

Browse files
committed
Remove mlab.binary_repr
1 parent f336729 commit 76864f0

3 files changed

Lines changed: 2 additions & 24 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.binary_repr`
1718
- `mlab.log2` (use numpy.log2 instead)
1819
- `mlab.cohere_pairs` (use scipy.signal.coherence instead)
1920
- `mlab.entropy` (use scipy.stats.entropy instead)

lib/matplotlib/mlab.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,29 +1247,6 @@ def movavg(x, n):
12471247
"""
12481248

12491249

1250-
@cbook.deprecated("2.2")
1251-
def binary_repr(number, max_length=1025):
1252-
"""
1253-
Return the binary representation of the input *number* as a
1254-
string.
1255-
1256-
This is more efficient than using :func:`base_repr` with base 2.
1257-
1258-
Increase the value of max_length for very large numbers. Note that
1259-
on 32-bit machines, 2**1023 is the largest integer power of 2
1260-
which can be converted to a Python float.
1261-
"""
1262-
1263-
# assert number < 2L << max_length
1264-
shifts = map(operator.rshift, max_length * [number],
1265-
range(max_length - 1, -1, -1))
1266-
digits = list(map(operator.mod, shifts, max_length * [2]))
1267-
if not digits.count(1):
1268-
return 0
1269-
digits = digits[digits.index(1):]
1270-
return ''.join(map(repr, digits)).replace('L', '')
1271-
1272-
12731250
@cbook.deprecated("2.2")
12741251
def ispower2(n):
12751252
"""

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
## We are still importing too many things from mlab; more cleanup is needed.
230230

231231
from matplotlib.mlab import (
232-
binary_repr, csv2rec,
232+
csv2rec,
233233
demean, detrend, detrend_linear, detrend_mean, detrend_none,
234234
ispower2, isvector,
235235
movavg,

0 commit comments

Comments
 (0)