Skip to content

Remove redundant variables in pcolormesh. #8801

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
Jun 26, 2017

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jun 26, 2017

I was going through pcolormesh in Cartopy to optimize it a bit, and I noticed these extra copies of variables, which I cleaned up and want to keep in sync, hence this PR. I don't believe the first bit saves much as they're probably views in latest NumPy, but dropping the extra pts should save a little bit of memory.

@QuLogic QuLogic added this to the 2.1 (next point release) milestone Jun 26, 2017
@QuLogic QuLogic requested a review from anntzer June 26, 2017 06:03
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a while to understand everything but I guess all my code look like that too :-)
lgtm

@anntzer anntzer changed the title Remove redundant variables in pcolormesh. [MRG+1] Remove redundant variables in pcolormesh. Jun 26, 2017
@efiring efiring changed the title [MRG+1] Remove redundant variables in pcolormesh. Remove redundant variables in pcolormesh. Jun 26, 2017
@efiring efiring merged commit 5a06397 into matplotlib:master Jun 26, 2017
@efiring
Copy link
Member

efiring commented Jun 26, 2017

Nice cleanup, thank you.

@QuLogic QuLogic deleted the pcolormesh-redundancies branch June 26, 2017 10:17
QuLogic added a commit to QuLogic/cartopy that referenced this pull request Jun 27, 2017
efiring added a commit to efiring/matplotlib that referenced this pull request Jun 27, 2017
Closes matplotlib#8534 (divide-by-zero warning).
Also fixes a bug that became evident with matplotlib#8801, which causes
pcolormesh to fail if X or Y is a masked array.  Although masked
arrays are not supported by pcolormesh, previously it would ignore
the mask.  Locators always return masked arrays, so the present
commit explicitly converts to an ndarray the Locator output used
by proportional colorbars.
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.

3 participants