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

Skip to content

Fix masked array handling #4050

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 6 commits into from
Jan 30, 2015
Merged

Fix masked array handling #4050

merged 6 commits into from
Jan 30, 2015

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Jan 29, 2015

This fixes #4049, and is an alternative to #4008. Unlike #4008, this fixes the problem directly in _fast_from_vertices_and_codes rather than at a number of call sites that call it. While it does make that function slower, it apparently needs the masked array treatment from all places that call it anyway, so sticking it right inside the function seems fine.

In the process of fixing this bug, it was discovered that a fix to handle NaNs in draw_markers (cf43d57) was not brought over from the 1.4.x branch (probably my fault, since merges of C++ code are really hairy right now). This missing bugfix was papered over by the fact that NaNs were no longer being passed to draw_markers.

Lastly, this adds an optimization to the log scaling to use NaNs rather than masked arrays. The original array is not touched, so this should be effectively the same thing, just without the large time and memory overhead of masked arrays.

This includes a test I shamelessly cherry-picked from #4008.

@tacaswell tacaswell added this to the v1.5.x milestone Jan 29, 2015
The docs on Path._fast_from_codes_and_verts said that `codes`
can not be None, however the code does not check this and everyplace
that `Path` uses `self._codes` it first verifies that the value is
not `None` and `None` is a valid value to be passed to the Path `__init__`
which falls through with the `_codes` attribute being `None`.
@mdboom mdboom changed the title Issue4049 Fix masked array handling Jan 29, 2015
@mdboom mdboom added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: confirmed bug and removed Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labels Jan 29, 2015
tacaswell added a commit that referenced this pull request Jan 30, 2015
Fix : masked array handling
@tacaswell tacaswell merged commit 36c14b5 into matplotlib:master Jan 30, 2015
@mdboom mdboom deleted the issue4049 branch March 3, 2015 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with plotting zeros in log space
2 participants