@@ -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
216216class 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
553553def interpgrid (a , xi , yi ):
554554 """Fast 2D, linear interpolation on an integer grid"""
0 commit comments