@@ -103,19 +103,19 @@ def get_memlimit_per_process(self, queue):
103103 if queue not in self .queues :
104104 raise ValueError ('Unknown queue: {:s}' .format (queue ))
105105
106- lim = self ._query ('qconf -sq ' + queue +
107- '| grep h_vmem | awk {\' print $2\' }' )[0 ]
106+ lim = self ._query ('qconf -sq ' + queue + (
107+ '| grep h_vmem | awk {\' print $2\' }' ) )[0 ]
108108
109- _ , lim_int , lim_units = re .split ('(\d+)' , lim )
109+ _ , lim_int , lim_units = re .split (r '(\d+)' , lim )
110110 assert isinstance (int (lim_int ), int )
111111 assert isinstance (lim_units , string_types )
112112
113113 return (lim )
114114
115115 def _check_parallel_env (self , queue , pe_name ):
116116 """Check that a PE is in the pe_list for a given queue"""
117- pes = self ._query ('qconf -sq ' + queue +
118- '| grep pe_list' )[0 ] # just one line
117+ pes = self ._query ('qconf -sq ' + queue + (
118+ '| grep pe_list' )) [0 ] # just one line
119119 pe_list = pes .split ()[1 :]
120120 if pe_name not in pe_list :
121121 raise ValueError ('Queue \' {0}\' does not support the \' {1}\' '
@@ -238,14 +238,14 @@ def __init__(self,
238238 'Maximum number of parallel threads is one (1) when total '
239239 'memory consumption is specified.' )
240240 # XXX would be nice with some sanity checking here...
241- _ , totmem , totmem_unit = re .split ('(\d+)' , self .total_memory )
242- _ , memlim , memlim_unit = re .split ('(\d+)' , h_vmem )
241+ _ , totmem , totmem_unit = re .split (r '(\d+)' , self .total_memory )
242+ _ , memlim , memlim_unit = re .split (r '(\d+)' , h_vmem )
243243
244244 if totmem_unit != memlim_unit :
245245 units = dict (k = 1e3 , m = 1e6 , g = 1e9 , t = 1e12 )
246246 try :
247247 ratio = units [totmem_unit .lower ()] / \
248- units [memlim_unit .lower ()]
248+ units [memlim_unit .lower ()]
249249 except KeyError :
250250 raise ValueError ('Something is wrong with the memory units'
251251 ', likely {:s}' .format (self .total_memory ))
@@ -310,9 +310,9 @@ def _initialise_cmd(self, value):
310310 def _create_qsub_script (self , job_name , cwd_flag , opt_threaded_flag ,
311311 opt_h_vmem_flag , log_name_prefix ):
312312 """All variables should be defined"""
313- if (self .cmd is None or self .queue is None or job_name is None
314- or cwd_flag is None or opt_threaded_flag is None
315- or opt_h_vmem_flag is None ):
313+ if (self .cmd is None or self .queue is None or job_name is None or
314+ cwd_flag is None or opt_threaded_flag is None or
315+ opt_h_vmem_flag is None ):
316316 raise ValueError ('This should not happen, please report an Issue!' )
317317
318318 self ._qsub_script = \
@@ -367,7 +367,7 @@ def submit(self, fake=False, sh_file='~/submit_job.sh'):
367367 else :
368368 # py2-3 safety
369369 output = output .decode ('ascii' , 'ignore' ).rstrip ()
370- m = re .search ('(\d+)' , output )
370+ m = re .search (r '(\d+)' , output )
371371 self ._jobid = m .group (1 )
372372 if self ._cleanup_qsub_job :
373373 self ._delete_qsub_job ()
@@ -387,8 +387,8 @@ def _check_status(self):
387387 ' | awk \' {print $5, $8}\' ' )[0 ] # ONLY
388388
389389 if len (output ) == 0 :
390- if (self ._submitted and not self ._running and not self . _completed
391- and not self ._waiting ):
390+ if (self ._submitted and not self ._running and not
391+ self . _completed and not self ._waiting ):
392392 self ._status_msg = ('Submission failed, see log for'
393393 ' output errors!' )
394394 elif self ._submitted and not self ._completed :
@@ -485,8 +485,8 @@ def verbose(self, value):
485485 def kill (self , jobid = None ):
486486 """Kill (delete) all the jobs in the batch."""
487487 for job in self ._joblist :
488- if (jobid is None
489- or ( jobid is not None and int (job ._jobid ) == int (jobid ))):
488+ if (jobid is None or (
489+ jobid is not None and int (job ._jobid ) == int (jobid ))):
490490 job .kill ()
491491
492492 def build_cmd (self ):
0 commit comments