Fix streamplot when color argument has NaNs #1514

Merged
merged 3 commits into from Dec 2, 2012

Conversation

Projects
None yet
3 participants
Contributor

tonysyu commented Nov 16, 2012

Bug report and fix provided by Jon Ramsey.

@tonysyu tonysyu BUG: Mask NaNs in color arrays passed to streamplot
Bug report and fix provided by Jon Ramsey.
8350feb
Member

dmcdougall commented Nov 16, 2012

@tonysyu Could you also add a test for this so we don't run into it again?

Contributor

tonysyu commented Nov 17, 2012

@dmcdougall Good point. I just added tests for streamplot.

Note that I'm on OS X, which marks SVG tests as KnownFails. I'm not sure if this is due to issues with the testing infrastructure or with the generation of SVGs on OS X, but if it's the latter I assume someone else will need to replace the SVGs that I pushed.

Member

pelson commented Nov 19, 2012

Thanks for adding the tests @tonysyu. Just to note, the comparison files such as streamplot_colormap_test_image_pdf.png should not be included in the baseline images (streamplot_colormap_test_image.pdf should and is).

Cheers,

Contributor

tonysyu commented Nov 21, 2012

@pelson Thanks for the help. Fixed.

Member

dmcdougall commented Nov 26, 2012

Note that I'm on OS X, which marks SVG tests as KnownFails. I'm not sure if this is due to issues with the testing infrastructure or with the generation of SVGs on OS X, but if it's the latter I assume someone else will need to replace the SVGs that I pushed.

Does anyone know what the situation is here?

@tonysyu Do you have inkscape installed? That might be why you're getting KnownFails for the SVG tests.

Contributor

tonysyu commented Nov 27, 2012

@dmcdougall I do actually have inkscape installed, but it appears that I have the CLI for inkscape linked in some incompatible way. I'll look into fixing this, but I'm a bit short on time.

Do you know if the tests fail on your system using the SVGs in this PR?

Member

dmcdougall commented Nov 27, 2012

Do you know if the tests fail on your system using the SVGs in this PR?

$ python tests.py matplotlib.tests.test_streamplot
....../opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/ma/core.py:3785: UserWarning: Warning: converting a masked element to nan.
  warnings.warn("Warning: converting a masked element to nan.")
...
----------------------------------------------------------------------
Ran 9 tests in 24.685s

OK
Contributor

tonysyu commented Dec 2, 2012

Thanks for checking the SVG tests @dmcdougall. I guess that means the SVG test images are fine.

Is there anything else I should add/fix for this PR?

Member

dmcdougall commented Dec 2, 2012

@tonysyu Nope, you're good. Merging.

@dmcdougall dmcdougall added a commit that referenced this pull request Dec 2, 2012

@dmcdougall dmcdougall Merge pull request #1514 from tonysyu/streamplot-nan-colors
Fix streamplot when color argument has NaNs
295f9fa

@dmcdougall dmcdougall merged commit 295f9fa into matplotlib:master Dec 2, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment