Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad80008

Browse files
committed
STY: Fix under-indented line continuations.
1 parent 7248dda commit ad80008

File tree

9 files changed

+26
-31
lines changed

9 files changed

+26
-31
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ignore =
44
# Normal default
55
E121,E123,E126,E226,E24,E704,W503,W504,
66
# Additional ignores:
7-
E122, E127, E129, E131,
7+
E122, E127, E131,
88
E265, E266,
99
E305, E306,
1010
E722, E741,

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def _init_tests():
11611161

11621162
from matplotlib import ft2font
11631163
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
1164-
ft2font.__freetype_build_type__ != 'local'):
1164+
ft2font.__freetype_build_type__ != 'local'):
11651165
_log.warning(
11661166
f"Matplotlib is not built with the correct FreeType version to "
11671167
f"run tests. Rebuild without setting system_freetype=1 in "

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5814,7 +5814,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
58145814
# Transform from native to data coordinates?
58155815
t = collection._transform
58165816
if (not isinstance(t, mtransforms.Transform) and
5817-
hasattr(t, '_as_mpl_transform')):
5817+
hasattr(t, '_as_mpl_transform')):
58185818
t = t._as_mpl_transform(self.axes)
58195819

58205820
if t and any(t.contains_branch_seperately(self.transData)):
@@ -6046,7 +6046,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
60466046
# Transform from native to data coordinates?
60476047
t = collection._transform
60486048
if (not isinstance(t, mtransforms.Transform) and
6049-
hasattr(t, '_as_mpl_transform')):
6049+
hasattr(t, '_as_mpl_transform')):
60506050
t = t._as_mpl_transform(self.axes)
60516051

60526052
if t and any(t.contains_branch_seperately(self.transData)):
@@ -6198,7 +6198,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
61986198
dx = np.diff(x)
61996199
dy = np.diff(y)
62006200
if (np.ptp(dx) < 0.01 * abs(dx.mean()) and
6201-
np.ptp(dy) < 0.01 * abs(dy.mean())):
6201+
np.ptp(dy) < 0.01 * abs(dy.mean())):
62026202
style = "image"
62036203
else:
62046204
style = "pcolorimage"

lib/matplotlib/axes/_secondary_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def set_functions(self, functions):
189189
inverse.
190190
"""
191191
if (isinstance(functions, tuple) and len(functions) == 2 and
192-
callable(functions[0]) and callable(functions[1])):
192+
callable(functions[0]) and callable(functions[1])):
193193
# make an arbitrary convert from a two-tuple of functions
194194
# forward and inverse.
195195
self._functions = functions

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def get_datalim(self, transData):
199199
transform = self.get_transform()
200200
transOffset = self.get_offset_transform()
201201
if (not self._offsetsNone and
202-
not transOffset.contains_branch(transData)):
202+
not transOffset.contains_branch(transData)):
203203
# if there are offsets but in some coords other than data,
204204
# then don't use them for autoscaling.
205205
return transforms.Bbox.null()
@@ -331,11 +331,11 @@ def draw(self, renderer):
331331
edgecolors = self.get_edgecolor()
332332
do_single_path_optimization = False
333333
if (len(paths) == 1 and len(trans) <= 1 and
334-
len(facecolors) == 1 and len(edgecolors) == 1 and
335-
len(self._linewidths) == 1 and
336-
all(ls[1] is None for ls in self._linestyles) and
337-
len(self._antialiaseds) == 1 and len(self._urls) == 1 and
338-
self.get_hatch() is None):
334+
len(facecolors) == 1 and len(edgecolors) == 1 and
335+
len(self._linewidths) == 1 and
336+
all(ls[1] is None for ls in self._linestyles) and
337+
len(self._antialiaseds) == 1 and len(self._urls) == 1 and
338+
self.get_hatch() is None):
339339
if len(trans):
340340
combined_transform = transforms.Affine2D(trans[0]) + transform
341341
else:

lib/matplotlib/figure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,9 +2512,9 @@ def align_xlabels(self, axs=None):
25122512
if axc.xaxis.get_label_position() == labpo:
25132513
ss = axc.get_subplotspec()
25142514
nrows, ncols, rowc0, rowc1, colc, col1 = \
2515-
ss.get_rows_columns()
2515+
ss.get_rows_columns()
25162516
if (labpo == 'bottom' and rowc1 == row1 or
2517-
labpo == 'top' and rowc0 == row0):
2517+
labpo == 'top' and rowc0 == row0):
25182518
# grouper for groups of xlabels to align
25192519
self._align_xlabel_grp.join(ax, axc)
25202520

@@ -2580,9 +2580,9 @@ def align_ylabels(self, axs=None):
25802580
if axc.yaxis.get_label_position() == labpo:
25812581
ss = axc.get_subplotspec()
25822582
nrows, ncols, row0, row1, colc0, colc1 = \
2583-
ss.get_rows_columns()
2583+
ss.get_rows_columns()
25842584
if (labpo == 'left' and colc0 == col0 or
2585-
labpo == 'right' and colc1 == col1):
2585+
labpo == 'right' and colc1 == col1):
25862586
# grouper for groups of ylabels to align
25872587
self._align_ylabel_grp.join(ax, axc)
25882588

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,8 @@ def __init__(self,
632632
if isinstance(family, str):
633633
# Treat family as a fontconfig pattern if it is the only
634634
# parameter provided.
635-
if (style is None and
636-
variant is None and
637-
weight is None and
638-
stretch is None and
639-
size is None and
640-
fname is None):
635+
if (style is None and variant is None and weight is None and
636+
stretch is None and size is None and fname is None):
641637
self.set_fontconfig_pattern(family)
642638
return
643639

lib/matplotlib/scale.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def set_default_locators_and_formatters(self, axis):
109109
axis.set_major_formatter(ScalarFormatter())
110110
axis.set_minor_formatter(NullFormatter())
111111
# update the minor locator for x and y axis based on rcParams
112-
if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible']
113-
or axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
112+
if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or
113+
axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
114114
axis.set_minor_locator(AutoMinorLocator())
115115
else:
116116
axis.set_minor_locator(NullLocator())
@@ -194,8 +194,8 @@ def set_default_locators_and_formatters(self, axis):
194194
axis.set_major_formatter(ScalarFormatter())
195195
axis.set_minor_formatter(NullFormatter())
196196
# update the minor locator for x and y axis based on rcParams
197-
if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible']
198-
or axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
197+
if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or
198+
axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
199199
axis.set_minor_locator(AutoMinorLocator())
200200
else:
201201
axis.set_minor_locator(NullLocator())

lib/matplotlib/transforms.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ def _check(points):
287287
if isinstance(points, np.ma.MaskedArray):
288288
cbook._warn_external("Bbox bounds are a masked array.")
289289
points = np.asarray(points)
290-
if (points[1, 0] - points[0, 0] == 0 or
291-
points[1, 1] - points[0, 1] == 0):
290+
if any((points[1, :] - points[0, :]) == 0):
292291
cbook._warn_external("Singular Bbox.")
293292

294293
def frozen(self):
@@ -2246,8 +2245,8 @@ def blended_transform_factory(x_transform, y_transform):
22462245
A faster version of the blended transform is returned for the case
22472246
where both child transforms are affine.
22482247
"""
2249-
if (isinstance(x_transform, Affine2DBase)
2250-
and isinstance(y_transform, Affine2DBase)):
2248+
if (isinstance(x_transform, Affine2DBase) and
2249+
isinstance(y_transform, Affine2DBase)):
22512250
return BlendedAffine2D(x_transform, y_transform)
22522251
return BlendedGenericTransform(x_transform, y_transform)
22532252

@@ -2639,7 +2638,7 @@ def _revalidate(self):
26392638
# only recompute if the invalidation includes the non_affine part of
26402639
# the transform
26412640
if (self._invalid & self.INVALID_NON_AFFINE == self.INVALID_NON_AFFINE
2642-
or self._transformed_path is None):
2641+
or self._transformed_path is None):
26432642
self._transformed_path = \
26442643
self._transform.transform_path_non_affine(self._path)
26452644
self._transformed_points = \

0 commit comments

Comments
 (0)