@@ -108,7 +108,7 @@ def merge_correspondance(self, other):
108108 i = where (other .datasets == array (self .datasets [- 1 ]))[0 ]
109109 if len (i ) != 1 :
110110 raise Exception ('More than one intersection' )
111-
111+
112112 # Merge
113113 # Create a hash table
114114 translate = empty (other .current_id , dtype = 'u4' )
@@ -194,7 +194,7 @@ def store_correspondance(self, i_previous, i_current, nb_real_obs):
194194 def append (self , * args , ** kwargs ):
195195 self .nb_link_max = max (self .nb_link_max , len (args [0 ]))
196196 super (Correspondances , self ).append (* args , ** kwargs )
197-
197+
198198 def id_generator (self , nb_id ):
199199 """Generation id and incrementation
200200 """
@@ -221,7 +221,7 @@ def recense_dead_id_to_extend(self):
221221 list_previous_virtual_id .index (i ) for i in virtual_dead_id ]
222222 # Virtual obs which can be prolongate
223223 alive_virtual_obs = self .virtual_obs ['segment_size'
224- ][i_virtual_dead_id ] < self .nb_virtual
224+ ][i_virtual_dead_id ] < self .nb_virtual
225225 nb_virtual_extend = alive_virtual_obs .sum ()
226226 logging .debug ('%d virtual obs will be prolongate on the '
227227 'next step' , nb_virtual_extend )
@@ -230,7 +230,7 @@ def recense_dead_id_to_extend(self):
230230 self .previous_virtual_obs = self .virtual_obs
231231 # Creation of an virtual step for dead one
232232 self .virtual_obs = VirtualEddiesObservations (
233- size = nb_dead + nb_virtual_extend ,
233+ size = nb_dead + nb_virtual_extend ,
234234 track_extra_variables = self .previous_obs .track_extra_variables ,
235235 track_array_variables = self .previous_obs .track_array_variables ,
236236 array_variables = self .previous_obs .array_variables )
@@ -255,27 +255,27 @@ def recense_dead_id_to_extend(self):
255255 self .virtual_obs ['dlon' ][:nb_dead ] = obs_b ['lon' ] - obs_a ['lon' ]
256256 self .virtual_obs ['dlat' ][:nb_dead ] = obs_b ['lat' ] - obs_a ['lat' ]
257257 self .virtual_obs ['lon' ][:nb_dead
258- ] = obs_b ['lon' ] + self .virtual_obs ['dlon' ][:nb_dead ]
258+ ] = obs_b ['lon' ] + self .virtual_obs ['dlon' ][:nb_dead ]
259259 self .virtual_obs ['lat' ][:nb_dead
260- ] = obs_b ['lat' ] + self .virtual_obs ['dlat' ][:nb_dead ]
260+ ] = obs_b ['lat' ] + self .virtual_obs ['dlat' ][:nb_dead ]
261261 # Id which are extended
262262 self .virtual_obs ['track' ][:nb_dead ] = dead_id
263263 # Add previous virtual
264264 if nb_virtual_extend > 0 :
265265 obs_to_extend = self .previous_virtual_obs .obs [i_virtual_dead_id
266- ][alive_virtual_obs ]
266+ ][alive_virtual_obs ]
267267 for key in obs_b .dtype .fields .keys ():
268268 if key in ['lon' , 'lat' , 'time' , 'track' , 'segment_size' ,
269269 'dlon' , 'dlat' ] or 'contour_' in key :
270270 continue
271271 self .virtual_obs [key ][nb_dead :] = obs_to_extend [key ]
272272 self .virtual_obs ['lon' ][nb_dead :
273- ] = obs_to_extend ['lon' ] + obs_to_extend ['dlon' ]
273+ ] = obs_to_extend ['lon' ] + obs_to_extend ['dlon' ]
274274 self .virtual_obs ['lat' ][nb_dead :
275- ] = obs_to_extend ['lat' ] + obs_to_extend ['dlat' ]
275+ ] = obs_to_extend ['lat' ] + obs_to_extend ['dlat' ]
276276 self .virtual_obs ['track' ][nb_dead :] = obs_to_extend ['track' ]
277277 self .virtual_obs ['segment_size' ][nb_dead :
278- ] = obs_to_extend ['segment_size' ]
278+ ] = obs_to_extend ['segment_size' ]
279279 # Count
280280 self .virtual_obs ['segment_size' ][:] += 1
281281
@@ -318,7 +318,7 @@ def save(self, filename):
318318 # Create dimensions
319319 logging .debug ('Create Dimensions "Nlink" : %d' , self .nb_link_max )
320320 h_nc .createDimension ('Nlink' , self .nb_link_max )
321-
321+
322322 logging .debug ('Create Dimensions "Nstep" : %d' , nb_step )
323323 h_nc .createDimension ('Nstep' , nb_step )
324324 var_file_in = h_nc .createVariable (
@@ -333,16 +333,16 @@ def save(self, filename):
333333
334334 var_nb_link = h_nc .createVariable (
335335 zlib = True , complevel = 1 ,
336- varname = 'nb_link' , datatype = 'u2' , dimensions = ( 'Nstep' ) )
337-
336+ varname = 'nb_link' , datatype = 'u2' , dimensions = 'Nstep' )
337+
338338 for name , dtype in self .correspondance_dtype :
339339 if dtype is bool_ :
340340 dtype = 'byte'
341341 h_nc .createVariable (zlib = True ,
342342 complevel = 1 ,
343343 varname = name ,
344344 datatype = dtype ,
345- dimensions = ('Nstep' ,'Nlink' ))
345+ dimensions = ('Nstep' , 'Nlink' ))
346346
347347 for i , correspondance in enumerate (self ):
348348 nb_elt = correspondance .shape [0 ]
@@ -389,8 +389,8 @@ def prepare_merging(self):
389389 # correspondance
390390 self .nb_obs_by_tracks [
391391 correspondance ['id' ][correspondance ['virtual' ]]
392- ] += correspondance ['virtual_length' ][
393- correspondance ['virtual' ]]
392+ ] += correspondance ['virtual_length' ][
393+ correspondance ['virtual' ]]
394394
395395 # Compute index of each tracks
396396 self .i_current_by_tracks = \
@@ -414,7 +414,7 @@ def merge(self, until=-1):
414414 track_extra_variables = self .current_obs .track_extra_variables ,
415415 track_array_variables = self .current_obs .track_array_variables ,
416416 array_variables = self .current_obs .array_variables ,
417- )
417+ )
418418
419419 # Calculate the index in each tracks, we compute in u4 and translate
420420 # in u2 (which are limited to 65535)
@@ -433,7 +433,7 @@ def merge(self, until=-1):
433433
434434 # To know if the track start
435435 first_obs_save_in_tracks = zeros (self .i_current_by_tracks .shape ,
436- dtype = bool_ )
436+ dtype = bool_ )
437437
438438 for i , file_name in enumerate (self .datasets [1 :]):
439439 if until != - 1 and i >= until :
@@ -455,7 +455,7 @@ def merge(self, until=-1):
455455 for field in fields :
456456 var = field [0 ]
457457 eddies [var ][index_final [m_first_obs ]
458- ] = self .previous_obs [var ][index_in ]
458+ ] = self .previous_obs [var ][index_in ]
459459 # Increment
460460 self .i_current_by_tracks [i_id [m_first_obs ]] += 1
461461 # Active this flag, we have only one first by tracks
@@ -469,7 +469,7 @@ def merge(self, until=-1):
469469 if m_virtual .any ():
470470 # Incrementing index
471471 self .i_current_by_tracks [i_id [m_virtual ]
472- ] += self [i ]['virtual_length' ][m_virtual ]
472+ ] += self [i ]['virtual_length' ][m_virtual ]
473473 # Get new index
474474 index_final = self .i_current_by_tracks [i_id ]
475475
@@ -480,7 +480,7 @@ def merge(self, until=-1):
480480 for field in fields :
481481 var = field [0 ]
482482 eddies [var ][index_final
483- ] = self .current_obs [var ][index_current ]
483+ ] = self .current_obs [var ][index_current ]
484484
485485 # Add increment for each index used
486486 self .i_current_by_tracks [i_id ] += 1
0 commit comments