@@ -137,8 +137,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
137
137
# Shift the seed points from the bottom left of the data so that
138
138
# data2grid works properly.
139
139
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 ])
142
142
for xs , ys in sp2 :
143
143
xg , yg = dmap .data2grid (xs , ys )
144
144
t = integrate (xg , yg )
@@ -211,7 +211,7 @@ def __init__(self, lines, arrows, **kwargs):
211
211
212
212
213
213
# Coordinate definitions
214
- #========================
214
+ # ========================
215
215
216
216
class DomainMap (object ):
217
217
"""Map representing different coordinate systems.
@@ -234,7 +234,7 @@ class DomainMap(object):
234
234
def __init__ (self , grid , mask ):
235
235
self .grid = grid
236
236
self .mask = mask
237
- ## Constants for conversion between grid- and mask-coordinates
237
+ # Constants for conversion between grid- and mask-coordinates
238
238
self .x_grid2mask = float (mask .nx - 1 ) / grid .nx
239
239
self .y_grid2mask = float (mask .ny - 1 ) / grid .ny
240
240
@@ -246,8 +246,8 @@ def __init__(self, grid, mask):
246
246
247
247
def grid2mask (self , xi , yi ):
248
248
"""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 ) )
251
251
252
252
def mask2grid (self , xm , ym ):
253
253
return xm * self .x_mask2grid , ym * self .y_mask2grid
@@ -457,17 +457,17 @@ def _integrate_rk12(x0, y0, dmap, f):
457
457
solvers in most setups on my machine. I would recommend removing the
458
458
other two to keep things simple.
459
459
"""
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.
463
463
maxerror = 0.003
464
464
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.
471
471
maxds = min (1. / dmap .mask .nx , 1. / dmap .mask .ny , 0.1 )
472
472
473
473
ds = maxds
@@ -548,7 +548,7 @@ def _euler_step(xf_traj, yf_traj, dmap, f):
548
548
549
549
550
550
# Utility functions
551
- #========================
551
+ # ========================
552
552
553
553
def interpgrid (a , xi , yi ):
554
554
"""Fast 2D, linear interpolation on an integer grid"""
0 commit comments