Andrew Straw wrote:

>> may be the quickest and most general way to do it.  I believe
>> ~np.isfinite is both more general and significantly faster than np.isnan.
> 
> Clever, but it won't work as-is. np.isfinite('b') returns a
> NotImplementedType, and a default argument to scatter is c='b', which
> gets passed to this function. Anyhow, I implemented your idea with a
> check for NotImplementedType and some unit tests in r5791.
>

Andrew,

I think there were at least two problems with the delete_masked_points 
function after you added the isfinite check, one of which was left over 
from my earlier implementation, and one new one.  I ended up rewriting 
just about everything, including the unit tests and the docstring (which 
is not in rst--sorry, maybe I can fix that later).  Note that the 
function is now in cbook.

I hope the combination of the code, the docstring and the unit tests 
make the intended functionality clear, but it may all still be a bit 
confusing.  In any case, I think the new version does what is needed for 
scatter, hexbin, and windbarb, and may turn out to be more generally useful.

As a side note, I suspect the check for NotImplementedType is not 
robust; I can easily imagine isfinite being changed to raise an 
exception instead.  Therefore I did not use that check.

Eric

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to