8000 Add some mlab alternatives by dstansby · Pull Request #10563 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@dstansby
Copy link
Member

Note I've changed np to numpy to make things clearer. Partially solves #10382.

@dstansby dstansby added this to the v2.2.0 milestone Feb 21, 2018


@cbook.deprecated("2.2")
@cbook.deprecated("2.2", 'numpy.mod(n, 2)')
Copy link
Member

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]

Copy link
Member Author

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!)

@jklymak
Copy link
Member
jklymak commented Feb 23, 2018

Are none of these used internally? If they are, they should be removed while deprecating?

@QuLogic
Copy link
Member
QuLogic commented Feb 24, 2018

Should already have been removed in the previous PR.

@dstansby
Copy link
Member Author

Yeah, my previous big PR removed all the stuff that's deprecated from internal code.

@timhoffm timhoffm merged commit 72770e6 into matplotlib:master Feb 24, 2018
lumberbot-app bot pushed a commit that referenced this pull request Feb 24, 2018
@dstansby dstansby deleted the mlab-alts branch February 24, 2018 20:29
QuLogic added a commit that referenced this pull request Feb 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0