Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix streamplot when color argument has NaNs #1514

Merged
merged 3 commits into from

3 participants

@tonysyu

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
@dmcdougall
Collaborator

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

@tonysyu

@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.

@pelson
Collaborator

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,

@tonysyu

@pelson Thanks for the help. Fixed.

@dmcdougall
Collaborator

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.

@tonysyu

@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?

@dmcdougall
Collaborator

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
@tonysyu

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?

@dmcdougall
Collaborator

@tonysyu Nope, you're good. Merging.

@dmcdougall dmcdougall merged commit 295f9fa into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 16, 2012
  1. @tonysyu

    BUG: Mask NaNs in color arrays passed to streamplot

    tonysyu authored
    Bug report and fix provided by Jon Ramsey.
Commits on Nov 17, 2012
  1. @tonysyu
Commits on Nov 21, 2012
  1. @tonysyu
Something went wrong with that request. Please try again.