Skip to content

Commit 9895288

Browse files
authored
Merge pull request #16279 from anntzer/e128
STY: Fix underindented continuation lines.
2 parents 2bdf82b + 7a2a9db commit 9895288

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+320
-332
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, E128, E129, E131,
7+
E122, E125, E127, E129, E131,
88
E265, E266,
99
E305, E306,
1010
E722, E741,

doc/sphinxext/missing_references.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def _record_reference(self, record):
4747
self.app.env.missing_references_warnings = defaultdict(set)
4848

4949
record_missing_reference(self.app,
50-
self.app.env.missing_references_warnings,
51-
record.location)
50+
self.app.env.missing_references_warnings,
51+
record.location)
5252

5353
def filter(self, record):
5454
self._record_reference(record)
@@ -157,13 +157,14 @@ def _warn_unused_missing_references(app):
157157
return
158158

159159
# This is a dictionary of {(domain_type, target): locations}
160-
references_ignored = getattr(app.env,
161-
'missing_references_ignored_references', {})
160+
references_ignored = getattr(
161+
app.env, 'missing_references_ignored_references', {})
162162
references_events = getattr(app.env, 'missing_references_events', {})
163163

164164
# Warn about any reference which is no longer missing.
165165
for (domain_type, target), locations in references_ignored.items():
166-
missing_reference_locations = [_truncate_location(location)
166+
missing_reference_locations = [
167+
_truncate_location(location)
167168
for location in references_events.get((domain_type, target), [])]
168169

169170
# For each ignored reference location, ensure a missing reference
@@ -176,9 +177,9 @@ def _warn_unused_missing_references(app):
176177
f" from {app.config.missing_references_filename}."
177178
"It is no longer a missing reference in the docs.")
178179
logger.warning(msg,
179-
location=ignored_reference_location,
180-
type='ref',
181-
subtype=domain_type)
180+
location=ignored_reference_location,
181+
type='ref',
182+
subtype=domain_type)
182183

183184

184185
def save_missing_references_handler(app, exc):

examples/color/custom_cmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
# in the middle of the range.
148148
cdict4 = {**cdict3,
149149
'alpha': ((0.0, 1.0, 1.0),
150-
# (0.25, 1.0, 1.0),
150+
# (0.25, 1.0, 1.0),
151151
(0.5, 0.3, 0.3),
152-
# (0.75, 1.0, 1.0),
152+
# (0.75, 1.0, 1.0),
153153
(1.0, 1.0, 1.0)),
154154
}
155155

examples/images_contours_and_fields/contour_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
axs = _axs.flatten()
4242

4343
cset1 = axs[0].contourf(X, Y, Z, levels, norm=norm,
44-
cmap=cm.get_cmap(cmap, len(levels) - 1))
44+
cmap=cm.get_cmap(cmap, len(levels) - 1))
4545
# It is not necessary, but for the colormap, we need only the
4646
# number of levels minus 1. To avoid discretization error, use
4747
# either this number or a large number such as the default (256).
@@ -84,7 +84,7 @@
8484
# image pixel (each color block on the following subplot), so the
8585
# domain that is contoured does not extend beyond these pixel centers.
8686
im = axs[3].imshow(Z, interpolation='nearest', extent=extent,
87-
cmap=cmap, norm=norm)
87+
cmap=cmap, norm=norm)
8888
axs[3].contour(Z, levels, colors='k', origin='image', extent=extent)
8989
ylim = axs[3].get_ylim()
9090
axs[3].set_ylim(ylim[::-1])

examples/images_contours_and_fields/plot_streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
ax3 = fig.add_subplot(gs[1, 1])
4949
strm = ax3.streamplot(X, Y, U, V, color=U, linewidth=2,
50-
cmap='autumn', start_points=seed_points.T)
50+
cmap='autumn', start_points=seed_points.T)
5151
fig.colorbar(strm.lines)
5252
ax3.set_title('Controlling Starting Points')
5353

examples/images_contours_and_fields/tricontour_smooth_delaunay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def experiment_res(x, y):
119119

120120
fig, ax = plt.subplots()
121121
ax.set_aspect('equal')
122-
ax.set_title("Filtering a Delaunay mesh\n" +
123-
"(application to high-resolution tricontouring)")
122+
ax.set_title("Filtering a Delaunay mesh\n"
123+
"(application to high-resolution tricontouring)")
124124

125125
# 1) plot of the refined (computed) data contours:
126126
ax.tricontour(tri_refi, z_test_refi, levels=levels, cmap=cmap,

examples/lines_bars_and_markers/markevery_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def trim_axs(axs, N):
5353
###############################################################################
5454
# Plot each markevery case for linear x and y scales
5555

56-
fig1, axs = plt.subplots(rows, cols, figsize=figsize, constrained_layout=True)
56+
axs = plt.figure(figsize=figsize, constrained_layout=True).subplots(rows, cols)
5757
axs = trim_axs(axs, len(cases))
5858
for ax, case in zip(axs, cases):
5959
ax.set_title('markevery=%s' % str(case))
@@ -62,7 +62,7 @@ def trim_axs(axs, N):
6262
###############################################################################
6363
# Plot each markevery case for log x and y scales
6464

65-
fig2, axs = plt.subplots(rows, cols, figsize=figsize, constrained_layout=True)
65+
axs = plt.figure(figsize=figsize, constrained_layout=True).subplots(rows, cols)
6666
axs = trim_axs(axs, len(cases))
6767
for ax, case in zip(axs, cases):
6868
ax.set_title('markevery=%s' % str(case))
@@ -76,7 +76,7 @@ def trim_axs(axs, N):
7676
# it is always interpreted with respect to the first data point which might be
7777
# different to the first visible data point.
7878

79-
fig3, axs = plt.subplots(rows, cols, figsize=figsize, constrained_layout=True)
79+
axs = plt.figure(figsize=figsize, constrained_layout=True).subplots(rows, cols)
8080
axs = trim_axs(axs, len(cases))
8181
for ax, case in zip(axs, cases):
8282
ax.set_title('markevery=%s' % str(case))
@@ -91,8 +91,8 @@ def trim_axs(axs, N):
9191
###############################################################################
9292
# Plot each markevery case for polar plots
9393

94-
fig4, axs = plt.subplots(rows, cols, figsize=figsize,
95-
subplot_kw={'projection': 'polar'}, constrained_layout=True)
94+
axs = plt.figure(figsize=figsize, constrained_layout=True).subplots(
95+
rows, cols, subplot_kw={'projection': 'polar'})
9696
axs = trim_axs(axs, len(cases))
9797
for ax, case in zip(axs, cases):
9898
ax.set_title('markevery=%s' % str(case))

examples/statistics/barchart_demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ def plot_student_results(student, scores, cohort_size):
139139

140140
# Center the text vertically in the bar
141141
yloc = rect.get_y() + rect.get_height() / 2
142-
label = ax1.annotate(rank_str, xy=(width, yloc), xytext=(xloc, 0),
143-
textcoords="offset points",
144-
ha=align, va='center',
145-
color=clr, weight='bold', clip_on=True)
142+
label = ax1.annotate(
143+
rank_str, xy=(width, yloc), xytext=(xloc, 0),
144+
textcoords="offset points",
145+
horizontalalignment=align, verticalalignment='center',
146+
color=clr, weight='bold', clip_on=True)
146147
rect_labels.append(label)
147148

148149
# make the interactive mouse over give the bar title

examples/statistics/confidence_ellipse.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs):
7070
# two-dimensionl dataset.
7171
ell_radius_x = np.sqrt(1 + pearson)
7272
ell_radius_y = np.sqrt(1 - pearson)
73-
ellipse = Ellipse((0, 0),
74-
width=ell_radius_x * 2,
75-
height=ell_radius_y * 2,
76-
facecolor=facecolor,
77-
**kwargs)
73+
ellipse = Ellipse((0, 0), width=ell_radius_x * 2, height=ell_radius_y * 2,
74+
facecolor=facecolor, **kwargs)
7875

7976
# Calculating the stdandard deviation of x from
8077
# the squareroot of the variance and multiplying
@@ -176,11 +173,11 @@ def get_correlated_dataset(n, dependency, mu, scale):
176173
ax_nstd.scatter(x, y, s=0.5)
177174

178175
confidence_ellipse(x, y, ax_nstd, n_std=1,
179-
label=r'$1\sigma$', edgecolor='firebrick')
176+
label=r'$1\sigma$', edgecolor='firebrick')
180177
confidence_ellipse(x, y, ax_nstd, n_std=2,
181-
label=r'$2\sigma$', edgecolor='fuchsia', linestyle='--')
178+
label=r'$2\sigma$', edgecolor='fuchsia', linestyle='--')
182179
confidence_ellipse(x, y, ax_nstd, n_std=3,
183-
label=r'$3\sigma$', edgecolor='blue', linestyle=':')
180+
label=r'$3\sigma$', edgecolor='blue', linestyle=':')
184181

185182
ax_nstd.scatter(mu[0], mu[1], c='red', s=3)
186183
ax_nstd.set_title('Different standard deviations')
@@ -209,7 +206,7 @@ def get_correlated_dataset(n, dependency, mu, scale):
209206
# Plot the ellipse with zorder=0 in order to demonstrate
210207
# its transparency (caused by the use of alpha).
211208
confidence_ellipse(x, y, ax_kwargs,
212-
alpha=0.5, facecolor='pink', edgecolor='purple', zorder=0)
209+
alpha=0.5, facecolor='pink', edgecolor='purple', zorder=0)
213210

214211
ax_kwargs.scatter(x, y, s=0.5)
215212
ax_kwargs.scatter(mu[0], mu[1], c='red', s=3)

examples/subplots_axes_and_figures/axes_box_aspect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
# figure.
100100

101101
fig5, axs = plt.subplots(2, 2, sharex="col", sharey="row",
102-
gridspec_kw=dict(height_ratios=[1, 3],
103-
width_ratios=[3, 1]))
102+
gridspec_kw=dict(height_ratios=[1, 3],
103+
width_ratios=[3, 1]))
104104
axs[0, 1].set_visible(False)
105105
axs[0, 0].set_box_aspect(1/3)
106106
axs[1, 0].set_box_aspect(1)
@@ -138,7 +138,7 @@
138138
# following creates a 2 by 3 subplot grid with all square axes.
139139

140140
fig7, axs = plt.subplots(2, 3, subplot_kw=dict(box_aspect=1),
141-
sharex=True, sharey=True, constrained_layout=True)
141+
sharex=True, sharey=True, constrained_layout=True)
142142

143143
for i, ax in enumerate(axs.flat):
144144
ax.scatter(i % 3, -((i // 3) - 0.5)*200, c=[plt.cm.hsv(i / 6)], s=300)

0 commit comments

Comments
 (0)