Skip to content

Commit 8e87493

Browse files
authored
Merge pull request #16769 from QuLogic/style-fixes
Fix some small style issues
2 parents 0bf4f55 + 1270fc2 commit 8e87493

File tree

13 files changed

+35
-42
lines changed

13 files changed

+35
-42
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, E125, 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
@@ -1158,7 +1158,7 @@ def _init_tests():
11581158

11591159
from matplotlib import ft2font
11601160
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
1161-
ft2font.__freetype_build_type__ != 'local'):
1161+
ft2font.__freetype_build_type__ != 'local'):
11621162
_log.warning(
11631163
f"Matplotlib is not built with the correct FreeType version to "
11641164
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
@@ -5825,7 +5825,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
58255825
# Transform from native to data coordinates?
58265826
t = collection._transform
58275827
if (not isinstance(t, mtransforms.Transform) and
5828-
hasattr(t, '_as_mpl_transform')):
5828+
hasattr(t, '_as_mpl_transform')):
58295829
t = t._as_mpl_transform(self.axes)
58305830

58315831
if t and any(t.contains_branch_seperately(self.transData)):
@@ -6057,7 +6057,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
60576057
# Transform from native to data coordinates?
60586058
t = collection._transform
60596059
if (not isinstance(t, mtransforms.Transform) and
6060-
hasattr(t, '_as_mpl_transform')):
6060+
hasattr(t, '_as_mpl_transform')):
60616061
t = t._as_mpl_transform(self.axes)
60626062

60636063
if t and any(t.contains_branch_seperately(self.transData)):
@@ -6209,7 +6209,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
62096209
dx = np.diff(x)
62106210
dy = np.diff(y)
62116211
if (np.ptp(dx) < 0.01 * abs(dx.mean()) and
6212-
np.ptp(dy) < 0.01 * abs(dy.mean())):
6212+
np.ptp(dy) < 0.01 * abs(dy.mean())):
62136213
style = "image"
62146214
else:
62156215
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/axis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
# This list is being used for compatibility with Axes.grid, which
2525
# allows all Line2D kwargs.
26-
_line_AI = martist.ArtistInspector(mlines.Line2D)
27-
_line_param_names = _line_AI.get_setters()
28-
_line_param_aliases = [list(d)[0] for d in _line_AI.aliasd.values()]
26+
_line_inspector = martist.ArtistInspector(mlines.Line2D)
27+
_line_param_names = _line_inspector.get_setters()
28+
_line_param_aliases = [list(d)[0] for d in _line_inspector.aliasd.values()]
2929
_gridline_param_names = ['grid_' + name
3030
for name in _line_param_names + _line_param_aliases]
3131

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,8 @@ def __init__(self, toolmanager, parent, style=wx.TB_HORIZONTAL):
13441344
self._toolitems = {}
13451345
self._groups = {}
13461346

1347-
def add_toolitem(
1348-
self, name, group, position, image_file, description, toggle):
1349-
1347+
def add_toolitem(self, name, group, position, image_file, description,
1348+
toggle):
13501349
before, group = self._add_to_group(group, name, position)
13511350
idx = self.GetToolPos(before.Id)
13521351
if image_file:

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def get_datalim(self, transData):
197197
transform = self.get_transform()
198198
transOffset = self.get_offset_transform()
199199
if (not self._offsetsNone and
200-
not transOffset.contains_branch(transData)):
200+
not transOffset.contains_branch(transData)):
201201
# if there are offsets but in some coords other than data,
202202
# then don't use them for autoscaling.
203203
return transforms.Bbox.null()
@@ -329,11 +329,11 @@ def draw(self, renderer):
329329
edgecolors = self.get_edgecolor()
330330
do_single_path_optimization = False
331331
if (len(paths) == 1 and len(trans) <= 1 and
332-
len(facecolors) == 1 and len(edgecolors) == 1 and
333-
len(self._linewidths) == 1 and
334-
all(ls[1] is None for ls in self._linestyles) and
335-
len(self._antialiaseds) == 1 and len(self._urls) == 1 and
336-
self.get_hatch() is None):
332+
len(facecolors) == 1 and len(edgecolors) == 1 and
333+
len(self._linewidths) == 1 and
334+
all(ls[1] is None for ls in self._linestyles) and
335+
len(self._antialiaseds) == 1 and len(self._urls) == 1 and
336+
self.get_hatch() is None):
337337
if len(trans):
338338
combined_transform = transforms.Affine2D(trans[0]) + transform
339339
else:

lib/matplotlib/font_manager.py

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

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/tests/test_agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class BaseFilter:
101101
def get_pad(self, dpi):
102102
return 0
103103

104-
def process_image(padded_src, dpi):
104+
def process_image(self, padded_src, dpi):
105105
raise NotImplementedError("Should be overridden by subclasses")
106106

107107
def __call__(self, im, dpi):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy