Skip to content

Commit c773d80

Browse files
committed
Style/typo fixes.
1 parent a4d6768 commit c773d80

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

doc/api/api_changes/2017-01-30-AL_is_numlike_stringlike.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
````````````````````````````````````````````````````````````````````````````````````````
33

44
`cbook.is_numlike` now only checks that its argument is an instance of
5-
``(numbers.Number, np.Number)`` and. In particular, this means that arrays are
6-
now not num-like.
5+
``(numbers.Number, np.Number)``. In particular, this means that arrays are now
6+
not num-like.
77

88
`cbook.is_string_like` and `cbook.is_sequence_of_strings` have been
9-
deprecated. Use ``isinstance(obj, six.string_types)`` and ``all(isinstance(o,
10-
six.string_types) for o in obj) and not iterable(obj)`` instead.
9+
deprecated. Use ``isinstance(obj, six.string_types)`` and ``iterable(obj) and
10+
all(isinstance(o, six.string_types) for o in obj)`` instead.

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,8 @@ def set_aspect(self, aspect, adjustable=None, anchor=None):
12811281
etc.
12821282
===== =====================
12831283
"""
1284-
if isinstance(aspect, six.string_types) and aspect in ('equal', 'auto'):
1284+
if (isinstance(aspect, six.string_types)
1285+
and aspect in ('equal', 'auto')):
12851286
self._aspect = aspect
12861287
else:
12871288
self._aspect = float(aspect) # raise ValueError if necessary

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ def finddir(o, match, case=False):
12211221
is True require an exact case match.
12221222
"""
12231223
if case:
1224-
names = [(name, name) for name in dir(o) if isinstance(name, six.string_types)]
1224+
names = [(name, name) for name in dir(o)
1225+
if isinstance(name, six.string_types)]
12251226
else:
12261227
names = [(name.lower(), name) for name in dir(o)
12271228
if isinstance(name, six.string_types)]
@@ -1598,7 +1599,7 @@ def delete_masked_points(*args):
15981599
margs = []
15991600
seqlist = [False] * len(args)
16001601
for i, x in enumerate(args):
1601-
if ((not isinstance(x, six.string_types)) and iterable(x)
1602+
if (not isinstance(x, six.string_types) and iterable(x)
16021603
and len(x) == nrecs):
16031604
seqlist[i] = True
16041605
if isinstance(x, np.ma.MaskedArray):

lib/matplotlib/colors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,7 @@ def __init__(self, colors, name='from_list', N=None):
789789
if N is None:
790790
N = len(self.colors)
791791
else:
792-
if (isinstance(self.colors, six.string_types) and
793-
cbook.is_hashable(self.colors)):
792+
if isinstance(self.colors, six.string_types):
794793
self.colors = [self.colors] * N
795794
self.monochrome = True
796795
elif cbook.iterable(self.colors):

lib/matplotlib/lines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,8 @@ def update_from(self, other):
12891289

12901290
def _get_rgba_face(self, alt=False):
12911291
facecolor = self._get_markerfacecolor(alt=alt)
1292-
if isinstance(facecolor, six.string_types) and facecolor.lower() == 'none':
1292+
if (isinstance(facecolor, six.string_types)
1293+
and facecolor.lower() == 'none'):
12931294
rgbaFace = None
12941295
else:
12951296
rgbaFace = mcolors.to_rgba(facecolor, self._alpha)

lib/matplotlib/text.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ def set_bbox(self, rectprops):
506506
pad = 0.3
507507

508508
# boxstyle could be a callable or a string
509-
if isinstance(boxstyle, six.string_types) and "pad" not in boxstyle:
509+
if (isinstance(boxstyle, six.string_types)
510+
and "pad" not in boxstyle):
510511
boxstyle += ",pad=%0.2f" % pad
511512

512513
bbox_transmuter = props.pop("bbox_transmuter", None)
@@ -1865,8 +1866,10 @@ def _get_ref_xy(self, renderer):
18651866

18661867
if isinstance(self.xycoords, tuple):
18671868
s1, s2 = self.xycoords
1868-
if ((isinstance(s1, six.string_types) and s1.split()[0] == "offset") or
1869-
(isinstance(s2, six.string_types) and s2.split()[0] == "offset")):
1869+
if ((isinstance(s1, six.string_types)
1870+
and s1.split()[0] == "offset")
1871+
or (isinstance(s2, six.string_types)
1872+
and s2.split()[0] == "offset")):
18701873
raise ValueError("xycoords should not be an offset coordinate")
18711874
x, y = self.xy
18721875
x1, y1 = self._get_xy(renderer, x, y, s1)

0 commit comments

Comments
 (0)