@@ -205,20 +205,16 @@ def output_dir(self):
205205 if self ._hierarchy :
206206 outputdir = op .join (outputdir , * self ._hierarchy .split ('.' ))
207207 if self .parameterization :
208+ params_str = ['{}' .format (p ) for p in self .parameterization ]
208209 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 )
214212 return op .abspath (op .join (outputdir ,
215213 self .name ))
216214
217215 def set_input (self , parameter , val ):
218216 """ 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 )
222218 setattr (self .inputs , parameter , deepcopy (val ))
223219
224220 def get_output (self , parameter ):
@@ -278,7 +274,7 @@ def run(self, updatehash=False):
278274 self ._get_inputs ()
279275 self ._got_inputs = True
280276 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 )
282278 if op .exists (outdir ):
283279 logger .debug (os .listdir (outdir ))
284280 hash_info = self .hash_exists (updatehash = updatehash )
@@ -301,25 +297,19 @@ def run(self, updatehash=False):
301297 len (glob (json_unfinished_pat )) == 0 )
302298 if need_rerun :
303299 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 ())
315305 log_debug = config .get ('logging' , 'workflow_level' ) == 'DEBUG'
316306 if log_debug and not op .exists (hashfile ):
317307 exp_hash_paths = glob (json_pat )
318308 if len (exp_hash_paths ) == 1 :
319309 split_out = split_filename (exp_hash_paths [0 ])
320310 exp_hash_file_base = split_out [1 ]
321311 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 )
323313 try :
324314 prev_inputs = load_json (exp_hash_paths [0 ])
325315 except :
@@ -343,26 +333,26 @@ def run(self, updatehash=False):
343333 self ._interface .can_resume ) and not
344334 isinstance (self , MapNode ))
345335 if rm_outdir :
346- logger .debug ("Removing old %s and its contents" % outdir )
336+ logger .debug ("Removing old %s and its contents" , outdir )
347337 try :
348338 rmtree (outdir )
349339 except OSError as ex :
350340 outdircont = os .listdir (outdir )
351341 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 )
355345 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 )
358348 raise ex
359349 else :
360350 raise ex
361351
362352 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 )
366356 if isinstance (self , MapNode ):
367357 # remove old json files
368358 for filename in glob (op .join (outdir , '_0x*.json' )):
0 commit comments