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

Skip to content

cbook._putmask added to handle putmask deprecation in numpy > 1.6.x #480

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

Merged
merged 1 commit into from
Sep 20, 2011

Conversation

efiring
Copy link
Member

@efiring efiring commented Sep 18, 2011

putmask is deprecated in favor of the new and more powerful copyto.

I decided to make a compatibility version of putmask using copyto instead of the reverse because that easily yields an exact equivalence, whereas simulating a full copyto with numpy <=1.6.x would be more difficult. In the present scheme, cbook._putmask is an exact substitute for np.putmask that uses copyto internally when available, thereby suppressing the deprecation warning from numpy.

putmask is deprecated in favor of the new and more powerful copyto.
@jkseppan
Copy link
Member

The code looks fine. Why not call it cbook.putmask without the underscore?

@efiring
Copy link
Member Author

efiring commented Sep 19, 2011

On 09/19/2011 05:36 AM, Jouni K. Seppänen wrote:

The code looks fine. Why not call it cbook.putmask without the underscore?

Because we don't want to make it part of mpl's API; it is a temporary
(though probably long-lived) compatibility workaround. If a user wants
to do the same thing for the same reason, it is better for the user to
simply copy the code.

jkseppan added a commit that referenced this pull request Sep 20, 2011
cbook._putmask added to handle putmask deprecation in numpy > 1.6.x
@jkseppan jkseppan merged commit 0578147 into matplotlib:master Sep 20, 2011
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.

2 participants