FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove a copy in pcolormesh. by anntzer · Pull Request #6677 · matplotlib/matplotlib · GitHub

Repository navigation

Remove a copy in pcolormesh. - #6677

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
anntzer:copyless-pcolormesh
Oct 11, 2016
Merged

tacaswell merged 1 commit into
matplotlib:masterfrom
anntzer:copyless-pcolormesh

Conversation

anntzer commented Jul 3, 2016

Copy link
Copy Markdown
Contributor

This slightly increases the size of the maximum pcolormesh before
hitting a MemoryError. Test with

N = 6000; x, y = mgrid[:N, :N]; z = sin(x + y); pcolormesh(x, y, z)

The patch raises the maximum N to ~8000 on my system (depending on the
load).

OTOH, this probably(?) makes pcolormesh sensitive to later changes in
the input array.

Thoughts?

This slightly increases the size of the maximum pcolormesh before
hitting a MemoryError.  Test with

    N = 6000; x, y = mgrid[:N, :N]; z = sin(x + y); pcolormesh(x, y, z)

The patch raises the maximum N to ~8000 on my system (depending on the
load).

OTOH, this probably(?) makes pcolormesh sensitive to later changes in
the input array.
tacaswell added this to the 2.1 (next point release) milestone Jul 3, 2016

efiring commented Jul 3, 2016

Copy link
Copy Markdown
Member

At least when this is instantiated via pcolormesh, which I suspect is almost always the case, the coordinates array is generated within pcolormesh, so there is no danger--no need to copy it.
Apart from avoiding unnecessary copying, the biggest reduction in memory consumption would come from minimizing the unnecessary use of double precision.

anntzer commented Jul 3, 2016

Copy link
Copy Markdown
Contributor Author

On coordinates or on the data as well?
Actually perhaps it would makes sense to use float32 internally everywhere given that the extra precision of float64 is unlikely to ever matter?

efiring commented Jul 3, 2016

Copy link
Copy Markdown
Member

Yes, it seems to me that double precision is overkill for coordinates and for data, in almost all plotting situations. The question then is whether it is worth the trouble--and if so, when--to convert to single precision.

NelleV changed the title Remove a copy in pcolormesh. [MRG+1] Remove a copy in pcolormesh. Oct 11, 2016

Copy link
Copy Markdown
Member

Merging this as it makes things better.

There are still open questions about only using 32 bits (probably should do something like we did in imshow/colormappable to handle float128). Which probably needs means that we need to pull that into cbook.

tacaswell merged commit dc752b3 into matplotlib:master Oct 11, 2016
QuLogic changed the title [MRG+1] Remove a copy in pcolormesh. Remove a copy in pcolormesh. Oct 16, 2016
anntzer deleted the copyless-pcolormesh branch February 23, 2017 01:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL