-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add some mlab alternatives #10563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some mlab alternatives #10563
Conversation
lib/matplotlib/mlab.py
Outdated
|
|
||
|
|
||
| @cbook.deprecated("2.2") | ||
| @cbook.deprecated("2.2", 'numpy.mod(n, 2)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right.
From:
import numpy
from matplotlib import mlab
N = [37, 48, 64]
print('numpy:\t', list(map(lambda x: numpy.mod(x, 2), N)))
print('mlab:\t', list(map(mlab.ispower2, N)))I get:
numpy: [1, 0, 0]
mlab: [0, 0, 6]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that function doesn't quite do what it says on the tin (not that my alternative actually worked for determining if a number is a power of 2!)
|
Are none of these used internally? If they are, they should be removed while deprecating? |
|
Should already have been removed in the previous PR. |
|
Yeah, my previous big PR removed all the stuff that's deprecated from internal code. |
Backport PR #10563 on branch v2.2.x
Note I've changed
nptonumpyto make things clearer. Partially solves #10382.