Skip to content
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

Cleanup examples and re-enable pep8 #8603

Merged
merged 5 commits into from
May 12, 2017
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented May 11, 2017

PR Summary

PEP8 has not been running for a while, so fix the examples and do a bit of minor cleanup. Most of the PEP8 stuff is just deleting or adding blank lines. For the cleanup, I tried to use plt.subplots a bit more often in the examples that were updated.

The reason why so many examples are suddenly failing is that a whole directory was moved out of docs to examples and docs are pep8-exempt.

For the tutorials directory, I've allowed E402 and E501; these are already exempted for the examples directory and there are already very many long lines, so "fixing" this would cause a lot of churn and in some cases (tables, URLs, mostly) appear rather ugly.

Fixes #8498.

PR Checklist

  • [N/A] Has Pytest style unit tests
  • Code is PEP 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • [N/A] Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/whats_new.rst if major new feature
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Try and use `plt.subplots` more and remove extraneous `plt.draw`.
* E402 module level import not at top of file - Tutorials repeat
  themselves a bit so are likely to show imports more than once.
* E501 line too long (82 > 79 characters) - Already ignored for examples
  and this is already a problem	for many lines in the existing text.
This should make pep8 checks work again since all of the source
directory will be touched.

Also, make the test script verbose so it prints out what it's doing
(this is part of the recommendations from Travis.)
@QuLogic QuLogic added this to the 2.1 (next point release) milestone May 11, 2017
@QuLogic
Copy link
Member Author

QuLogic commented May 11, 2017

6690 passed, 6 skipped, 6 xfailed, 9 xpassed == 6711 tests on the 2.7 build
vs.
7553 passed, 14 skipped, 2 xfailed, 4 xpassed == 7573 tests on the 3.6 build
-> 862 pep8 tests, which matches what I have locally.

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

👍

@dopplershift dopplershift changed the title Cleanup examples and re-enable pep8 [MRG + 1] Cleanup examples and re-enable pep8 May 11, 2017
@dstansby dstansby merged commit 48584c7 into matplotlib:master May 12, 2017
@dstansby dstansby changed the title [MRG + 1] Cleanup examples and re-enable pep8 Cleanup examples and re-enable pep8 May 12, 2017
@tacaswell
Copy link
Member

Thanks for the detailed work @QuLogic !

@choldgraf
Copy link
Contributor

This is great, nice!

@QuLogic QuLogic deleted the pep8 branch May 12, 2017 21:12
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.

pep8 not running on examples on master
5 participants