Skip to content

Commit 786eb8c

Browse files
committed
Merge pull request #4722 from tacaswell/sty_pep8
STY: pep8 that slipped by the tests
2 parents ed196c6 + 46444bb commit 786eb8c

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

examples/images_contours_and_fields/streamplot_demo_start_points.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@
2020
seed_points = np.array([[-2, 0, 1], [-2, 0, 1]])
2121

2222
fig0, ax0 = plt.subplots()
23-
strm = ax0.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn, start_points=seed_points.T)
23+
strm = ax0.streamplot(X, Y, U, V, color=U, linewidth=2,
24+
cmap=plt.cm.autumn, start_points=seed_points.T)
2425
fig0.colorbar(strm.lines)
2526

2627
ax0.plot(seed_points[0], seed_points[1], 'bo')
2728

28-
ax0.axis((-3,3,-3,3))
29-
30-
31-
#plt.show()
29+
ax0.axis((-3, 3, -3, 3))

lib/matplotlib/streamplot.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
137137
# Shift the seed points from the bottom left of the data so that
138138
# data2grid works properly.
139139
sp2 = np.asanyarray(start_points).copy()
140-
sp2[:,0] += np.abs(x[0])
141-
sp2[:,1] += np.abs(y[0])
140+
sp2[:, 0] += np.abs(x[0])
141+
sp2[:, 1] += np.abs(y[0])
142142
for xs, ys in sp2:
143143
xg, yg = dmap.data2grid(xs, ys)
144144
t = integrate(xg, yg)
@@ -211,7 +211,7 @@ def __init__(self, lines, arrows, **kwargs):
211211

212212

213213
# Coordinate definitions
214-
#========================
214+
# ========================
215215

216216
class DomainMap(object):
217217
"""Map representing different coordinate systems.
@@ -234,7 +234,7 @@ class DomainMap(object):
234234
def __init__(self, grid, mask):
235235
self.grid = grid
236236
self.mask = mask
237-
## Constants for conversion between grid- and mask-coordinates
237+
# Constants for conversion between grid- and mask-coordinates
238238
self.x_grid2mask = float(mask.nx - 1) / grid.nx
239239
self.y_grid2mask = float(mask.ny - 1) / grid.ny
240240

@@ -246,8 +246,8 @@ def __init__(self, grid, mask):
246246

247247
def grid2mask(self, xi, yi):
248248
"""Return nearest space in mask-coords from given grid-coords."""
249-
return int((xi * self.x_grid2mask) + 0.5), \
250-
int((yi * self.y_grid2mask) + 0.5)
249+
return (int((xi * self.x_grid2mask) + 0.5),
250+
int((yi * self.y_grid2mask) + 0.5))
251251

252252
def mask2grid(self, xm, ym):
253253
return xm * self.x_mask2grid, ym * self.y_mask2grid
@@ -457,17 +457,17 @@ def _integrate_rk12(x0, y0, dmap, f):
457457
solvers in most setups on my machine. I would recommend removing the
458458
other two to keep things simple.
459459
"""
460-
## This error is below that needed to match the RK4 integrator. It
461-
## is set for visual reasons -- too low and corners start
462-
## appearing ugly and jagged. Can be tuned.
460+
# This error is below that needed to match the RK4 integrator. It
461+
# is set for visual reasons -- too low and corners start
462+
# appearing ugly and jagged. Can be tuned.
463463
maxerror = 0.003
464464

465-
## This limit is important (for all integrators) to avoid the
466-
## trajectory skipping some mask cells. We could relax this
467-
## condition if we use the code which is commented out below to
468-
## increment the location gradually. However, due to the efficient
469-
## nature of the interpolation, this doesn't boost speed by much
470-
## for quite a bit of complexity.
465+
# This limit is important (for all integrators) to avoid the
466+
# trajectory skipping some mask cells. We could relax this
467+
# condition if we use the code which is commented out below to
468+
# increment the location gradually. However, due to the efficient
469+
# nature of the interpolation, this doesn't boost speed by much
470+
# for quite a bit of complexity.
471471
maxds = min(1. / dmap.mask.nx, 1. / dmap.mask.ny, 0.1)
472472

473473
ds = maxds
@@ -548,7 +548,7 @@ def _euler_step(xf_traj, yf_traj, dmap, f):
548548

549549

550550
# Utility functions
551-
#========================
551+
# ========================
552552

553553
def interpgrid(a, xi, yi):
554554
"""Fast 2D, linear interpolation on an integer grid"""

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def finalize_options(self):
190190
if self.tests:
191191
self.test_args.append("--tests={names}".format(names=self.tests))
192192

193-
194193
def run(self):
195194
if self.distribution.install_requires:
196195
self.distribution.fetch_build_eggs(
@@ -201,7 +200,6 @@ def run(self):
201200
self.announce('running unittests with nose')
202201
self.with_project_on_sys_path(self.run_tests)
203202

204-
205203
def run_tests(self):
206204
import matplotlib
207205
matplotlib.use('agg')

0 commit comments

Comments
 (0)