From 201dd2f17e66be4f27facf5fdc6e2b742878a8e5 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 27 Dec 2014 01:13:22 -0500 Subject: [PATCH 1/2] PEP8: adjust some long lines --- lib/matplotlib/__init__.py | 3 ++- lib/matplotlib/artist.py | 2 +- lib/matplotlib/axis.py | 12 ++++++------ lib/matplotlib/bezier.py | 2 +- lib/matplotlib/tests/test_dates.py | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 9d711899876d..b02d979709ca 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -885,7 +885,8 @@ def __getitem__(self, key): key = alt return dict.__getitem__(self, key) - # http://stackoverflow.com/questions/2390827/how-to-properly-subclass-dict-and-override-get-set + # http://stackoverflow.com/questions/2390827 + # (how-to-properly-subclass-dict-and-override-get-set) # the default dict `update` does not use __setitem__ # so rcParams.update(...) (such as in seaborn) side-steps # all of the validation over-ride update to force diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 7fb492367f1d..0062f7929f7a 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -28,7 +28,7 @@ # python trick. The answer is that I need to be able to manipulate # the docstring, and there is no clever way to do that in python 2.2, # as far as I can see - see -# http://groups.google.com/groups?hl=en&lr=&threadm=mailman.5090.1098044946.5135.python-list%40python.org&rnum=1&prev=/groups%3Fq%3D__doc__%2Bauthor%253Ajdhunter%2540ace.bsd.uchicago.edu%26hl%3Den%26btnG%3DGoogle%2BSearch +# http://groups.google.com/groups?hl=en&lr=&threadm=mailman.5090.1098044946.5135.python-list%40python.org&rnum=1&prev=/groups%3Fq%3D__doc__%2Bauthor%253Ajdhunter%2540ace.bsd.uchicago.edu%26hl%3Den%26btnG%3DGoogle%2BSearch # noqa def allow_rasterization(draw): diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 5304602699b0..e36c8947fa19 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -1003,9 +1003,9 @@ def _update_ticks(self, renderer): ds1 = self._get_pixel_distance_along_axis( interval_expanded[0], -0.5) except: - warnings.warn("Unable to find pixel distance along axis for\ - interval padding of ticks; assuming no interval padding\ - needed.") + warnings.warn("Unable to find pixel distance along axis " + "for interval padding of ticks; assuming no " + "interval padding needed.") ds1 = 0.0 if np.isnan(ds1): ds1 = 0.0 @@ -1013,9 +1013,9 @@ def _update_ticks(self, renderer): ds2 = self._get_pixel_distance_along_axis( interval_expanded[1], +0.5) except: - warnings.warn("Unable to find pixel distance along axis for\ - interval padding of ticks; assuming no interval padding\ - needed.") + warnings.warn("Unable to find pixel distance along axis " + "for interval padding of ticks; assuming no " + "interval padding needed.") ds2 = 0.0 if np.isnan(ds2): ds2 = 0.0 diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index 8400edf6ef7e..9aee957b9b00 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -73,7 +73,7 @@ def get_normal_points(cx, cy, cos_t, sin_t, length): # BEZIER routines # subdividing bezier curve -# http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html +# http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html # noqa def _de_casteljau1(beta, t): diff --git a/lib/matplotlib/tests/test_dates.py b/lib/matplotlib/tests/test_dates.py index 7b847bb0df6d..00df11e27505 100644 --- a/lib/matplotlib/tests/test_dates.py +++ b/lib/matplotlib/tests/test_dates.py @@ -25,7 +25,7 @@ def test_date_empty(): # make sure mpl does the right thing when told to plot dates even # if no date data has been presented, cf - # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720 + # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720 # noqa fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.xaxis_date() @@ -88,7 +88,7 @@ def test_date_axvline(): @cleanup def test_too_many_date_ticks(): # Attempt to test SF 2715172, see - # https://sourceforge.net/tracker/?func=detail&aid=2715172&group_id=80706&atid=560720 + # https://sourceforge.net/tracker/?func=detail&aid=2715172&group_id=80706&atid=560720 # noqa # setting equal datetimes triggers and expander call in # transforms.nonsingular which results in too many ticks in the # DayLocator. This should trigger a Locator.MAXTICKS RuntimeError @@ -202,7 +202,7 @@ def test_drange(): @cleanup def test_empty_date_with_year_formatter(): # exposes sf bug 2861426: - # https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 + # https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 # noqa # update: I am no longer believe this is a bug, as I commented on # the tracker. The question is now: what to do with this test From afff43112cffcecf015b9e9d167c2ab1d19bd3c9 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 18 Feb 2015 22:45:06 -0500 Subject: [PATCH 2/2] MAINT: remove noqa comments --- lib/matplotlib/artist.py | 2 +- lib/matplotlib/bezier.py | 2 +- lib/matplotlib/tests/test_dates.py | 6 +++--- lib/mpl_toolkits/axes_grid1/anchored_artists.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 0062f7929f7a..7fb492367f1d 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -28,7 +28,7 @@ # python trick. The answer is that I need to be able to manipulate # the docstring, and there is no clever way to do that in python 2.2, # as far as I can see - see -# http://groups.google.com/groups?hl=en&lr=&threadm=mailman.5090.1098044946.5135.python-list%40python.org&rnum=1&prev=/groups%3Fq%3D__doc__%2Bauthor%253Ajdhunter%2540ace.bsd.uchicago.edu%26hl%3Den%26btnG%3DGoogle%2BSearch # noqa +# http://groups.google.com/groups?hl=en&lr=&threadm=mailman.5090.1098044946.5135.python-list%40python.org&rnum=1&prev=/groups%3Fq%3D__doc__%2Bauthor%253Ajdhunter%2540ace.bsd.uchicago.edu%26hl%3Den%26btnG%3DGoogle%2BSearch def allow_rasterization(draw): diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index 9aee957b9b00..8400edf6ef7e 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -73,7 +73,7 @@ def get_normal_points(cx, cy, cos_t, sin_t, length): # BEZIER routines # subdividing bezier curve -# http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html # noqa +# http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html def _de_casteljau1(beta, t): diff --git a/lib/matplotlib/tests/test_dates.py b/lib/matplotlib/tests/test_dates.py index 00df11e27505..7b847bb0df6d 100644 --- a/lib/matplotlib/tests/test_dates.py +++ b/lib/matplotlib/tests/test_dates.py @@ -25,7 +25,7 @@ def test_date_empty(): # make sure mpl does the right thing when told to plot dates even # if no date data has been presented, cf - # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720 # noqa + # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720 fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.xaxis_date() @@ -88,7 +88,7 @@ def test_date_axvline(): @cleanup def test_too_many_date_ticks(): # Attempt to test SF 2715172, see - # https://sourceforge.net/tracker/?func=detail&aid=2715172&group_id=80706&atid=560720 # noqa + # https://sourceforge.net/tracker/?func=detail&aid=2715172&group_id=80706&atid=560720 # setting equal datetimes triggers and expander call in # transforms.nonsingular which results in too many ticks in the # DayLocator. This should trigger a Locator.MAXTICKS RuntimeError @@ -202,7 +202,7 @@ def test_drange(): @cleanup def test_empty_date_with_year_formatter(): # exposes sf bug 2861426: - # https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 # noqa + # https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 # update: I am no longer believe this is a bug, as I commented on # the tracker. The question is now: what to do with this test diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 1fa0effc4f74..bfcfeea344a7 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -119,7 +119,7 @@ def __init__(self, transform, size, label, loc, >>> import matplotlib.font_manager as fm >>> fontprops = fm.FontProperties(size=14, family='monospace') - >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.5, color='white', fontproperties=fontprops) # noqa + >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.5, color='white', fontproperties=fontprops) """