2.0 Examples fixes. See #6762 #6786

Merged
merged 2 commits into from Jul 19, 2016

Conversation

Projects
None yet
4 participants
Contributor

mlub commented Jul 18, 2016 edited

These are fixes for all issues found in axes_grid, color, and
event_handling sections on the examples page.

axisartist/demo_curvelinear_grid.py - Set linewidth=2.0 and grid zorder=0 so
the plotted lines actually visible

event_handling/keypress_demo.py - added usage instruction as axes title

event_handling/lasso_demo.py - added usage instruction as axes title

event_handling/looking_glass.py - added usage instruction as axes title

event_handling/resample.py - removed scikits and hardcoded wave file dependencies
and instead create a sample signal within the script

event_handling/trifinder_event_demo.py - zip(l1,l2) call changed to
list(zip(l1,l2)) to be python3 compatible

event_handling/viewlims.py - The focus box that is supposed to appear in the
left axes when user zooms in the right axes wasn't visible. Set linewidth=1.0

@mlub mlub 2.0 Examples fixes. See #6762
These are fixes for all issues found in axes_grid, color, and
event_handling sections on the examples page.

axis_grid/demo_colorbar_with_inset_locator.py - changed interpolation from the
default(previously bilinear now none) to 'bilinear' to match 1.5.1 example

axes_grid1/simple_axesgrid.py - set interpolation to bilinear

axisartist/demo_curvelinear_grid.py - Set linewidth=2.0 and grid zorder=0 so
the plotted lines actually visible

event_handling/keypress_demo.py - added usage instruction as axes title

event_handling/lasso_demo.py - added usage instruction as axes title

event_handling/looking_glass.py - added usage instruction as axes title

event_handling/resample.py - removed gtk and hardcoded wave file dependencies
and just created a sample signal within the script

event_handling/trifinder_event_demo.py - zip(l1,l2) call changed to
list(zip(l1,l2)) to be python3 compatible

event_handling/viewlims.py - The focus box that is supposed to appear in the
left axes when user zooms in the right axes wasn't visible. Set linewidth=1.0
0e07fd2

mdboom added the needs_review label Jul 18, 2016

Owner

tacaswell commented Jul 18, 2016

Thanks!

I am 👎 on changing the examples back to bilinear.

It looks like this put a bunch of pep8 issues in

======================================================================
FAIL: matplotlib.tests.test_coding_standards.test_pep8_conformance_examples
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matplotlib/matplotlib/lib/matplotlib/tests/test_coding_standards.py", line 274, in test_pep8_conformance_examples
    expected_bad_files=expected_bad_files)
  File "/home/travis/build/matplotlib/matplotlib/lib/matplotlib/tests/test_coding_standards.py", line 143, in assert_pep8_conformance
    assert_equal(result.total_errors, 0, msg)
AssertionError: 6 != 0 : Found code syntax errors (and warnings):
/home/travis/build/matplotlib/matplotlib/examples/event_handling/looking_glass.py:15:1: E302 expected 2 blank lines, found 1
/home/travis/build/matplotlib/matplotlib/examples/event_handling/resample.py:35:23: E231 missing whitespace after ','
/home/travis/build/matplotlib/matplotlib/examples/event_handling/resample.py:35:27: E231 missing whitespace after ','
/home/travis/build/matplotlib/matplotlib/examples/event_handling/resample.py:36:62: E703 statement ends with a semicolon
/home/travis/build/matplotlib/matplotlib/examples/event_handling/resample.py:43:31: E231 missing whitespace after ','
/home/travis/build/matplotlib/matplotlib/examples/event_handling/resample.py:51:1: W391 blank line at end of file
----------------------------------------------------------------------

We decided a long time ago to enforce a code style via the package formally known as pep8.

If I recall correctly, you use emacs. I suggest installing elpy in emacs and flake8 in your python enviroment to get pep8 linting in emacs.

@mlub mlub 2.0 Examples fixes. See #6762
These are fixes for all issues found in axes_grid, color, and
event_handling sections on the examples page.

axisartist/demo_curvelinear_grid.py - Set linewidth=2.0 and grid zorder=0 so
the plotted lines actually visible

event_handling/keypress_demo.py - added usage instruction as axes title

event_handling/lasso_demo.py - added usage instruction as axes title

event_handling/looking_glass.py - added usage instruction as axes title

event_handling/resample.py - removed gtk and hardcoded wave file dependencies
and just created a sample signal within the script

event_handling/trifinder_event_demo.py - zip(l1,l2) call changed to
list(zip(l1,l2)) to be python3 compatible

event_handling/viewlims.py - The focus box that is supposed to appear in the
left axes when user zooms in the right axes wasn't visible. Set linewidth=1.0
eb41064
Contributor

mlub commented Jul 19, 2016

Removed the bilinear mods and corrected the pep8 issues @tacaswell

@tacaswell tacaswell merged commit 2bf445d into matplotlib:master Jul 19, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 70.369%
Details

tacaswell removed the needs_review label Jul 19, 2016

Owner

tacaswell commented Jul 19, 2016

🎉 Congratulations on what (I think) is your first contribution to mpl!

Documentation is someplace that we do not put enough effort into and this work is greatly appreciated.

@tacaswell tacaswell added a commit that referenced this pull request Jul 19, 2016

@tacaswell tacaswell Merge pull request #6786 from mlub/examplestesting
DOC: 2.0 Examples fixes

See #6762
8396451
Owner

tacaswell commented Jul 19, 2016

backported to v2.x as 2bf445d

Member

QuLogic commented Oct 16, 2016

The backport is actually 8396451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment