8000 Only test png output for mplot3d. by anntzer · Pull Request #13901 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Only test png output for mplot3d. #13901

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 1 commit into from
Jun 5, 2019

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Apr 7, 2019

mplot3d is not exercising any pdf or svg-specific code paths so we can
just test pngs only, saving ~1.8Mb of baseline images (especially if we
regenerate them).

See discussion starting at #8896 (comment).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@eric-wieser
Copy link
Contributor

Possibly worth mentioning in the commit message that the choice of png over pdf is for ease of diffing, despite size costs

@anntzer anntzer force-pushed the mplo3dtestpngonly branch from d65f30b to a50c7ea Compare April 7, 2019 20:56
@anntzer
Copy link
Contributor Author
anntzer commented Apr 7, 2019

good point, edited the commit message accordingly

@@ -11,6 +13,9 @@
import numpy as np


image_comparison = partial(image_comparison, extensions=['png'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image_comparison = partial(image_comparison, extensions=['png'])
png_image_comparison = partial(image_comparison, extensions=['png'])

That caught me by surprise. I was scolling past this and just saw the decorators with removed extensions parameter. Please use png_image_comparison or image_comparison_png. Having the same function name but with different API is a bit unclear; in particular also because we from ... import image_comparison in other tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, fixed

@anntzer anntzer force-pushed the mplo3dtestpngonly branch from a50c7ea to 016a8cb Compare April 8, 2019 01:20
@@ -269,7 +260,7 @@ def test_text3d():
ax.set_zlabel('Z axis')


@image_comparison(baseline_images=['trisurf3d'], remove_text=True, tol=0.03)
@image_comparison_png(baseline_images=['trisurf3d'], remove_text=True, tol=0.03)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (80 > 79 characters), here and in 5 other places

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could fix by renaming to png_comparison

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed... should be fixed now

@anntzer anntzer force-pushed the mplo3dtestpngonly branch from 016a8cb to 4b05bcb Compare April 8, 2019 09:05
@tacaswell tacaswell added this to the v3.2.0 milestone Apr 8, 2019
Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove the comment about the flaky svg tests (that are now gone, although that does suggest that we were exercising something funny about the SVG backend, however by gut guess is that it is related to the (previous lack of) stability of dictionary iteration).

@tacaswell
Copy link
Member

Attn @WeatherGod

@anntzer anntzer force-pushed the mplo3dtestpngonly branch from 4b05bcb to 16f67f9 Compare April 8, 2019 23:27
@anntzer
Copy link
Contributor Author
anntzer commented Apr 8, 2019

@tacaswell edited accordingly

@tacaswell tacaswell requested a review from WeatherGod April 9, 2019 01:28
@tacaswell
Copy link
Member

I would prefer we wait for @WeatherGod to sign off on this.

@WeatherGod
Copy link
Member
WeatherGod commented Apr 9, 2019 via email

@anntzer
Copy link
Contributor Author
anntzer commented Apr 9, 2019

Can you point out which is the specifically problematic test? At least right now all vector files (that got deleted in this PR) appear identical to the corresponding png files (by visual inspection).
The test coverage doesn't drop, suggesting that all previously tested code paths in the vector backends are still being exercised.
If there are really some tricky points in the vector output, it would be better if they were exercised by a 2D plot rather than as a side effect by a 3D test, anyways...

@QuLogic
Copy link
Member
QuLogic commented May 29, 2019

So this can be shortened now with #14166?

@anntzer anntzer force-pushed the mplo3dtestpngonly branch from 16f67f9 to 3a7dff3 Compare May 29, 2019 08:57
@anntzer
Copy link
Contributor Author
anntzer commented May 29, 2019

indeed, done.

mplot3d is not exercising any pdf or svg-specific code paths so we can
just test pngs only, saving ~1.8Mb of baseline images (especially if we
regenerate them).

pngs were chosen instead of pdfs, despite being bigger, because they can
be visually diffed on Github.
@anntzer anntzer force-pushed the mplo3dtestpngonly branch from 3a7dff3 to e0e51f3 Compare May 29, 2019 08:58
@anntzer
Copy link
Contributor Author
anntzer commented Jun 5, 2019

@tacaswell @timhoffm either of you wants to merge this? :) (both of you already approved)

@timhoffm timhoffm merged commit 5b7ccfe into matplotlib:master Jun 5, 2019
@anntzer anntzer deleted the mplo3dtestpngonly branch June 5, 2019 21:59
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.

6 participants
0