8000 Fix some indent-related style lints. · matplotlib/matplotlib@61517ca · GitHub
[go: up one dir, main page]

Skip to content

Commit 61517ca

Browse files
committed
Fix some indent-related style lints.
Deleting most of the comments in tinypages/conf.py seems better than trying to fix them...
1 parent a26f9a3 commit 61517ca

File tree

9 files changed

+56
-284
lines changed

9 files changed

+56
-284
lines changed

.flake8

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ignore =
1616
# flake8 default
1717
E121,E123,E126,E226,E24,E704,W503,W504,
1818
# Additional ignores:
19-
E122, E127, E131,
19+
E127, E131,
2020
E266,
2121
E305, E306,
2222
E722, E741,
@@ -47,9 +47,9 @@ per-file-ignores =
4747

4848
lib/matplotlib/__init__.py: F401
4949
lib/matplotlib/_api/__init__.py: F401
50-
lib/matplotlib/_cm.py: E202, E203, E302
50+
lib/matplotlib/_cm.py: E122, E202, E203, E302
5151
lib/matplotlib/_mathtext.py: E221, E251
52-
lib/matplotlib/_mathtext_data.py: E203, E261
52+
lib/matplotlib/_mathtext_data.py: E122, E203, E261
5353
lib/matplotlib/animation.py: F401
5454
lib/matplotlib/_animation_data.py: E501
5555
lib/matplotlib/axes/__init__.py: F401, F403

lib/matplotlib/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,17 +1285,14 @@ def _add_data_doc(docstring, replace_names):
12851285
12861286
Objects passed as **data** must support item access (``data[s]``) and
12871287
membership test (``s in data``)."""
1288-
if replace_names is None else ("""\
1288+
if replace_names is None else f"""\
12891289
If given, the following parameters also accept a string ``s``, which
12901290
is interpreted as ``data[s]`` (unless this raises an exception):
12911291
1292-
{names}
1292+
{', '.join(map('*{}*'.format, replace_names))}
12931293
12941294
Objects passed as **data** must support item access (``data[s]``) and
1295-
membership test (``s in data``).""".format(
1296-
names=", ".join(map("*{}*".format, replace_names)))
1297-
)
1298-
)
1295+
membership test (``s in data``).""")
12991296
# using string replacement instead of formatting has the advantages
13001297
# 1) simpler indent handling
13011298
# 2) prevent problems with formatting characters '{', '%' in the docstring

lib/matplotlib/_cm.py

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -459,39 +459,45 @@ def _g36(x): return 2 * x - 1
459459
'blue': ((0., 1., 1.), (1.0, 0.5, 0.5))}
460460

461461
_nipy_spectral_data = {
462-
'red': [(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
463-
(0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
464-
(0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
465-
(0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
466-
(0.40, 0.0, 0.0), (0.45, 0.0, 0.0),
467-
(0.50, 0.0, 0.0), (0.55, 0.0, 0.0),
468-
(0.60, 0.0, 0.0), (0.65, 0.7333, 0.7333),
469-
(0.70, 0.9333, 0.9333), (0.75, 1.0, 1.0),
470-
(0.80, 1.0, 1.0), (0.85, 1.0, 1.0),
471-
(0.90, 0.8667, 0.8667), (0.95, 0.80, 0.80),
472-
(1.0, 0.80, 0.80)],
473-
'green': [(0.0, 0.0, 0.0), (0.05, 0.0, 0.0),
474-
(0.10, 0.0, 0.0), (0.15, 0.0, 0.0),
475-
(0.20, 0.0, 0.0), (0.25, 0.4667, 0.4667),
476-
(0.30, 0.6000, 0.6000), (0.35, 0.6667, 0.6667),
477-
8000 (0.40, 0.6667, 0.6667), (0.45, 0.6000, 0.6000),
478-
(0.50, 0.7333, 0.7333), (0.55, 0.8667, 0.8667),
479-
(0.60, 1.0, 1.0), (0.65, 1.0, 1.0),
480-
(0.70, 0.9333, 0.9333), (0.75, 0.8000, 0.8000),
481-
(0.80, 0.6000, 0.6000), (0.85, 0.0, 0.0),
482-
(0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
483-
(1.0, 0.80, 0.80)],
484-
'blue': [(0.0, 0.0, 0.0), (0.05, 0.5333, 0.5333),
485-
(0.10, 0.6000, 0.6000), (0.15, 0.6667, 0.6667),
486-
(0.20, 0.8667, 0.8667), (0.25, 0.8667, 0.8667),
487-
(0.30, 0.8667, 0.8667), (0.35, 0.6667, 0.6667),
488-
(0.40, 0.5333, 0.5333), (0.45, 0.0, 0.0),
489-
(0.5, 0.0, 0.0), (0.55, 0.0, 0.0),
490-
(0.60, 0.0, 0.0), (0.65, 0.0, 0.0),
491-
(0.70, 0.0, 0.0), (0.75, 0.0, 0.0),
492-
(0.80, 0.0, 0.0), (0.85, 0.0, 0.0),
493-
(0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
494-
(1.0, 0.80, 0.80)],
462+
'red': [
463+
(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
464+
(0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
465+
(0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
466+
(0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
467+
(0.40, 0.0, 0.0), (0.45, 0.0, 0.0),
468+
(0.50, 0.0, 0.0), (0.55, 0.0, 0.0),
469+
(0.60, 0.0, 0.0), (0.65, 0.7333, 0.7333),
470+
(0.70, 0.9333, 0.9333), (0.75, 1.0, 1.0),
471+
(0.80, 1.0, 1.0), (0.85, 1.0, 1.0),
472+
(0.90, 0.8667, 0.8667), (0.95, 0.80, 0.80),
473+
(1.0, 0.80, 0.80),
474+
],
475+
'green': [
476+
(0.0, 0.0, 0.0), (0.05, 0.0, 0.0),
477+
(0.10, 0.0, 0.0), (0.15, 0.0, 0.0),
478+
(0.20, 0.0, 0.0), (0.25, 0.4667, 0.4667),
479+
(0.30, 0.6000, 0.6000), (0.35, 0.6667, 0.6667),
480+
(0.40, 0.6667, 0.6667), (0.45, 0.6000, 0.6000),
481+
(0.50, 0.7333, 0.7333), (0.55, 0.8667, 0.8667),
482+
(0.60, 1.0, 1.0), (0.65, 1.0, 1.0),
483+
(0.70, 0.9333, 0.9333), (0.75, 0.8000, 0.8000),
484+
(0.80, 0.6000, 0.6000), (0.85, 0.0, 0.0),
485+
(0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
486+
(1.0, 0.80, 0.80),
487+
],
488+
'blue': [
489+
(0.0, 0.0, 0.0), (0.05, 0.5333, 0.5333),
490+
(0.10, 0.6000, 0.6000), (0.15, 0.6667, 0.6667),
491+
(0.20, 0.8667, 0.8667), (0.25, 0.8667, 0.8667),
492+
(0.30, 0.8667, 0.8667), (0.35, 0.6667, 0.6667),
493+
(0.40, 0.5333, 0.5333), (0.45, 0.0, 0.0),
494+
(0.5, 0.0, 0.0), (0.55, 0.0, 0.0),
495+
(0.60, 0.0, 0.0), (0.65, 0.0, 0.0),
496+
(0.70, 0.0, 0.0), (0.75, 0.0, 0.0),
497+
(0.80, 0.0, 0.0), (0.85, 0.0, 0.0),
498+
(0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
499+
(1.0, 0.80, 0.80),
500+
],
495501
}
496502

497503

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5683,9 +5683,8 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
56835683
y = Y.reshape(Ny, 1)
56845684
Y = y.repeat(Nx, axis=1)
56855685
if X.shape != Y.shape:
5686-
raise TypeError(
5687-
'Incompatible X, Y inputs to %s; see help(%s)' % (
5688-
funcname, funcname))
5686+
raise TypeError(f'Incompatible X, Y inputs to {funcname}; '
5687+
f'see help({funcname})')
56895688

56905689
if shading == 'auto':
56915690
if ncols == Nx and nrows == Ny:

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,14 +1053,14 @@ def _convert_validator_spec(key, conv):
10531053
"legend.scatterpoints": validate_int,
10541054
"legend.fontsize": validate_fontsize,
10551055
"legend.title_fontsize": validate_fontsize_None,
1056-
# color of the legend
1056+
# color of the legend
10571057
"legend.labelcolor": _validate_color_or_linecolor,
1058-
# the relative size of legend markers vs. original
1058+
# the relative size of legend markers vs. original
10591059
"legend.markerscale": validate_float,
10601060
"legend.shadow": validate_bool,
1061-
# whether or not to draw a frame around legend
1061+
# whether or not to draw a frame around legend
10621062
"legend.frameon": validate_bool,
1063-
# alpha value of the legend frame
1063+
# alpha value of the legend frame
10641064
"legend.framealpha": validate_float_or_None,
10651065

10661066
## the following dimensions are in fraction of the font size

lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def test_cursor_data():
340340
"data, text_without_colorbar, text_with_colorbar", [
341341
([[10001, 10000]], "[1e+04]", "[10001]"),
342342
([[.123, .987]], "[0.123]", "[0.123]"),
343-
])
343+
])
344344
def test_format_cursor_data(data, text_without_colorbar, text_with_colorbar):
345345
from matplotlib.backend_bases import MouseEvent
346346

lib/matplotlib/tests/test_mlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_detrend_linear_2d(self):
262262
([], 255, 33, -1, -1, None),
263263
([], 256, 128, -1, 256, 256),
264264
([], None, -1, 32, -1, -1),
265-
],
265+
],
266266
ids=[
267267
'nosig',
268268
'Fs4',

lib/matplotlib/tests/test_type1font.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def test_Type1Font():
2525
'- FontDirectory/CMR10 known{/CMR10 findfont dup/UniqueID known{dup',
2626
'+ FontDirectory/CMR10 known{/CMR10 findfont dup',
2727
# Changes the font name
28-
'- /FontName /CMR10 def',
29-
'+ /FontName /CMR10_Slant_1000 def',
28+
'- /FontName /CMR10 def',
29+
'+ /FontName /CMR10_Slant_1000 def',
3030
# Alters FontMatrix
3131
'- /FontMatrix [0.001 0 0 0.001 0 0 ]readonly def',
3232
'+ /FontMatrix [0.001 0 0.001 0.001 0 0]readonly def',
@@ -43,7 +43,7 @@ def test_Type1Font():
4343
'- FontDirectory/CMR10 known{/CMR10 findfont dup/UniqueID known{dup',
4444
'+ FontDirectory/CMR10 known{/CMR10 findfont dup',
4545
# Changes the font name
46-
'- /FontName /CMR10 def',
46+
'- /FontName /CMR10 def',
4747
'+ /FontName /CMR10_Extend_500 def',
4848
# Alters FontMatrix
4949
'- /FontMatrix [0.001 0 0 0.001 0 0 ]readonly def',

0 commit comments

Comments
 (0)
0