@@ -205,20 +205,16 @@ def output_dir(self):
205
205
if self ._hierarchy :
206
206
outputdir = op .join (outputdir , * self ._hierarchy .split ('.' ))
207
207
if self .parameterization :
208
+ params_str = ['{}' .format (p ) for p in self .parameterization ]
208
209
if not str2bool (self .config ['execution' ]['parameterize_dirs' ]):
209
- param_dirs = [self ._parameterization_dir (p ) for p in
210
- self .parameterization ]
211
- outputdir = op .join (outputdir , * param_dirs )
212
- else :
213
- outputdir = op .join (outputdir , * self .parameterization )
210
+ params_str = [self ._parameterization_dir (p ) for p in params_str ]
211
+ outputdir = op .join (outputdir , * params_str )
214
212
return op .abspath (op .join (outputdir ,
215
213
self .name ))
216
214
217
215
def set_input (self , parameter , val ):
218
216
""" Set interface input value"""
219
- logger .debug ('setting nodelevel(%s) input %s = %s' % (str (self ),
220
- parameter ,
221
- str (val )))
217
+ logger .debug ('setting nodelevel(%s) input %s = %s' , self .name , parameter , val )
222
218
setattr (self .inputs , parameter , deepcopy (val ))
223
219
224
220
def get_output (self , parameter ):
@@ -278,7 +274,7 @@ def run(self, updatehash=False):
278
274
self ._get_inputs ()
279
275
self ._got_inputs = True
280
276
outdir = self .output_dir ()
281
- logger .info ("Executing node %s in dir: %s" % ( self ._id , outdir ) )
277
+ logger .info ("Executing node %s in dir: %s" , self ._id , outdir )
282
278
if op .exists (outdir ):
283
279
logger .debug (os .listdir (outdir ))
284
280
hash_info = self .hash_exists (updatehash = updatehash )
@@ -301,25 +297,19 @@ def run(self, updatehash=False):
301
297
len (glob (json_unfinished_pat )) == 0 )
302
298
if need_rerun :
303
299
logger .debug ("Rerunning node" )
304
- logger .debug (("updatehash = %s, "
305
- "self.overwrite = %s, "
306
- "self._interface.always_run = %s, "
307
- "os.path.exists(%s) = %s, "
308
- "hash_method = %s" ) %
309
- (str (updatehash ),
310
- str (self .overwrite ),
311
- str (self ._interface .always_run ),
312
- hashfile ,
313
- str (op .exists (hashfile )),
314
- self .config ['execution' ]['hash_method' ].lower ()))
300
+ logger .debug (
301
+ "updatehash = %s, self.overwrite = %s, self._interface.always_run = %s, "
302
+ "os.path.exists(%s) = %s, hash_method = %s" , updatehash , self .overwrite ,
303
+ self ._interface .always_run , hashfile , op .exists (hashfile ),
304
+ self .config ['execution' ]['hash_method' ].lower ())
315
305
log_debug = config .get ('logging' , 'workflow_level' ) == 'DEBUG'
316
306
if log_debug and not op .exists (hashfile ):
317
307
exp_hash_paths = glob (json_pat )
318
308
if len (exp_hash_paths ) == 1 :
319
309
split_out = split_filename (exp_hash_paths [0 ])
320
310
exp_hash_file_base = split_out [1 ]
321
311
exp_hash = exp_hash_file_base [len ('_0x' ):]
322
- logger .debug ("Previous node hash = %s" % exp_hash )
312
+ logger .debug ("Previous node hash = %s" , exp_hash )
323
313
try :
324
314
prev_inputs = load_json (exp_hash_paths [0 ])
325
315
except :
@@ -343,26 +333,26 @@ def run(self, updatehash=False):
343
333
self ._interface .can_resume ) and not
344
334
isinstance (self , MapNode ))
345
335
if rm_outdir :
346
- logger .debug ("Removing old %s and its contents" % outdir )
336
+ logger .debug ("Removing old %s and its contents" , outdir )
347
337
try :
348
338
rmtree (outdir )
349
339
except OSError as ex :
350
340
outdircont = os .listdir (outdir )
351
341
if ((ex .errno == errno .ENOTEMPTY ) and (len (outdircont ) == 0 )):
352
- logger .warn (( 'An exception was raised trying to remove old %s, '
353
- ' but the path seems empty. Is it an NFS mount?. '
354
- ' Passing the exception.') % outdir )
342
+ logger .warn (
343
+ 'An exception was raised trying to remove old %s, but the path '
344
+ 'seems empty. Is it an NFS mount?. Passing the exception.', outdir )
355
345
elif ((ex .errno == errno .ENOTEMPTY ) and (len (outdircont ) != 0 )):
356
- logger .debug (( 'Folder contents (%d items): '
357
- ' %s') % ( len (outdircont ), outdircont ) )
346
+ logger .debug (
347
+ 'Folder contents (%d items): %s', len (outdircont ), outdircont )
358
348
raise ex
359
349
else :
360
350
raise ex
361
351
362
352
else :
363
- logger .debug (( "%s found and can_resume is True or Node is a "
364
- " MapNode - resuming execution") %
365
- hashfile_unfinished )
353
+ logger .debug (
354
+ "%s found and can_resume is True or Node is a MapNode - resuming execution",
355
+ hashfile_unfinished )
366
356
if isinstance (self , MapNode ):
367
357
# remove old json files
368
358
for filename in glob (op .join (outdir , '_0x*.json' )):
0 commit comments