Skip to content

Commit c83a85a

Browse files
committed
PEP8 fixes 2. => 2.0
1 parent 7cd4399 commit c83a85a

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

lib/matplotlib/cbook.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ def __call__(self, *args, **kwargs):
205205
if self.inst is not None and self.inst() is None:
206206
raise ReferenceError
207207
elif self.inst is not None:
208-
# build a new instance method with a strong reference to the instance
208+
# build a new instance method with a strong reference to the
209+
# instance
209210
if sys.version_info[0] >= 3:
210211
mtd = types.MethodType(self.func, self.inst())
211212
else:
@@ -458,7 +459,9 @@ def __init__(self, **kwds):
458459

459460
def __repr__(self):
460461
keys = self.__dict__.iterkeys()
461-
return 'Bunch(%s)' % ', '.join(['%s=%s' % (k, self.__dict__[k]) for k in keys])
462+
return 'Bunch(%s)' % ', '.join(['%s=%s' % (k, self.__dict__[k])
463+
for k
464+
in keys])
462465

463466

464467
def unique(x):
@@ -1507,7 +1510,8 @@ def simple_linear_interpolation(a, steps):
15071510

15081511
def recursive_remove(path):
15091512
if os.path.isdir(path):
1510-
for fname in glob.glob(os.path.join(path, '*')) + glob.glob(os.path.join(path, '.*')):
1513+
for fname in glob.glob(os.path.join(path, '*')) + \
1514+
glob.glob(os.path.join(path, '.*')):
15111515
if os.path.isdir(fname):
15121516
recursive_remove(fname)
15131517
os.removedirs(fname)
@@ -1661,7 +1665,9 @@ def less_simple_linear_interpolation(x, y, xi, extrap=False):
16611665
it from there
16621666
"""
16631667
# deprecated from cbook in 0.98.4
1664-
warnings.warn('less_simple_linear_interpolation has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1668+
warnings.warn('less_simple_linear_interpolation has been moved to '
1669+
'matplotlib.mlab -- please import it from there',
1670+
DeprecationWarning)
16651671
import matplotlib.mlab as mlab
16661672
return mlab.less_simple_linear_interpolation(x, y, xi, extrap=extrap)
16671673

@@ -1672,20 +1678,22 @@ def isvector(X):
16721678
it from there
16731679
"""
16741680
# deprecated from cbook in 0.98.4
1675-
warnings.warn('isvector has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1681+
warnings.warn('isvector has been moved to matplotlib.mlab -- please '
1682+
'import it from there', DeprecationWarning)
16761683
import matplotlib.mlab as mlab
16771684
return mlab.isvector(x, y, xi, extrap=extrap)
16781685

16791686

1680-
def vector_lengths(X, P=2., axis=None):
1687+
def vector_lengths(X, P=2.0, axis=None):
16811688
"""
16821689
This function has been moved to matplotlib.mlab -- please import
16831690
it from there
16841691
"""
16851692
# deprecated from cbook in 0.98.4
1686-
warnings.warn('vector_lengths has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1693+
warnings.warn('vector_lengths has been moved to matplotlib.mlab -- '
1694+
'please import it from there', DeprecationWarning)
16871695
import matplotlib.mlab as mlab
1688-
return mlab.vector_lengths(X, P=2., axis=axis)
1696+
return mlab.vector_lengths(X, P=2.0, axis=axis)
16891697

16901698

16911699
def distances_along_curve(X):
@@ -1694,7 +1702,8 @@ def distances_along_curve(X):
16941702
it from there
16951703
"""
16961704
# deprecated from cbook in 0.98.4
1697-
warnings.warn('distances_along_curve has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1705+
warnings.warn('distances_along_curve has been moved to matplotlib.mlab '
1706+
'-- please import it from there', DeprecationWarning)
16981707
import matplotlib.mlab as mlab
16991708
return mlab.distances_along_curve(X)
17001709

@@ -1705,7 +1714,8 @@ def path_length(X):
17051714
it from there
17061715
"""
17071716
# deprecated from cbook in 0.98.4
1708-
warnings.warn('path_length has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1717+
warnings.warn('path_length has been moved to matplotlib.mlab '
1718+
'-- please import it from there', DeprecationWarning)
17091719
import matplotlib.mlab as mlab
17101720
return mlab.path_length(X)
17111721

@@ -1716,7 +1726,8 @@ def is_closed_polygon(X):
17161726
it from there
17171727
"""
17181728
# deprecated from cbook in 0.98.4
1719-
warnings.warn('is_closed_polygon has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1729+
warnings.warn('is_closed_polygon has been moved to matplotlib.mlab '
1730+
'-- please import it from there', DeprecationWarning)
17201731
import matplotlib.mlab as mlab
17211732
return mlab.is_closed_polygon(X)
17221733

@@ -1727,7 +1738,8 @@ def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y):
17271738
it from there
17281739
"""
17291740
# deprecated from cbook in 0.98.4
1730-
warnings.warn('quad2cubic has been moved to matplotlib.mlab -- please import it from there', DeprecationWarning)
1741+
warnings.warn('quad2cubic has been moved to matplotlib.mlab -- please '
1742+
'import it from there', DeprecationWarning)
17311743
import matplotlib.mlab as mlab
17321744
return mlab.quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y)
17331745

@@ -1763,7 +1775,8 @@ def __call__(self, key):
17631775
raise ValueError("Iterator has been left behind")
17641776
return retval
17651777

1766-
# This can be made more efficient by not computing the minimum key for each iteration
1778+
# This can be made more efficient by not computing the minimum key for each
1779+
# iteration
17671780
iters = [myiter(it) for it in iterables]
17681781
minvals = minkey = True
17691782
while 1:
@@ -1782,7 +1795,8 @@ def is_math_text(s):
17821795
s = unicode(s)
17831796
except UnicodeDecodeError:
17841797
raise ValueError(
1785-
"matplotlib display text must have all code points < 128 or use Unicode strings")
1798+
"matplotlib display text must have all code points < 128 or use "
1799+
"Unicode strings")
17861800

17871801
dollar_count = s.count(r'$') - s.count(r'\$')
17881802
even_dollars = (dollar_count > 0 and dollar_count % 2 == 0)

0 commit comments

Comments
 (0)