@@ -287,7 +287,6 @@ def __init__(
287287 self .n_processes = self ._parse_n_processes (n_processes )
288288
289289 def _setup_logger (self ) -> logging .Logger :
290-
291290 # better safe than sorry
292291 os .makedirs (self .logfile_dir , exist_ok = True )
293292
@@ -310,7 +309,6 @@ def _setup_logger(self) -> logging.Logger:
310309 return logger
311310
312311 def _parse_diffcrash_home (self , diffcrash_home ) -> str :
313-
314312 diffcrash_home_ok = len (diffcrash_home ) != 0
315313
316314 msg = self ._msg_option .format ("diffcrash-home" , diffcrash_home )
@@ -328,7 +326,6 @@ def _parse_diffcrash_home(self, diffcrash_home) -> str:
328326 return diffcrash_home
329327
330328 def _parse_crash_code (self , crash_code ) -> str :
331-
332329 # these guys are allowed
333330 valid_crash_codes = ["dyna" , "radioss" , "pam" ]
334331
@@ -340,16 +337,14 @@ def _parse_crash_code(self, crash_code) -> str:
340337
341338 if not crash_code_ok :
342339 err_msg = (
343- f"Invalid crash code '{ crash_code } '. "
344- f"Please use one of: { str (valid_crash_codes )} "
340+ f"Invalid crash code '{ crash_code } '. Please use one of: { str (valid_crash_codes )} "
345341 )
346342 self .logger .error (err_msg )
347343 raise RuntimeError (str_error (err_msg ))
348344
349345 return crash_code
350346
351347 def _parse_reference_run (self , reference_run ) -> str :
352-
353348 reference_run_ok = Path (reference_run ).is_file ()
354349
355350 msg = self ._msg_option .format ("reference-run" , reference_run )
@@ -364,7 +359,6 @@ def _parse_reference_run(self, reference_run) -> str:
364359 return reference_run
365360
366361 def _parse_use_id_mapping (self , use_id_mapping ) -> bool :
367-
368362 msg = self ._msg_option .format ("use-id-mapping" , use_id_mapping )
369363 print (str_info (msg ))
370364 self .logger .info (msg )
@@ -386,7 +380,6 @@ def _parse_simulation_runs(
386380 reference_run : str ,
387381 exclude_runs : typing .Sequence [str ],
388382 ):
389-
390383 # search all denoted runs
391384 simulation_runs = []
392385 for pattern in simulation_run_patterns :
@@ -442,19 +435,16 @@ def natural_keys(text):
442435 return simulation_runs
443436
444437 def _parse_config_file (self , config_file ) -> Union [str , None ]:
445-
446438 _msg_config_file = ""
447439 if len (config_file ) > 0 and not Path (config_file ).is_file ():
448440 config_file = None
449441 _msg_config_file = f"Can not find config file '{ config_file } '"
450442
451443 # missing config file
452444 else :
453-
454445 config_file = None
455446 _msg_config_file = (
456- "Config file missing. "
457- "Consider specifying the path with the option '--config-file'."
447+ "Config file missing. Consider specifying the path with the option '--config-file'."
458448 )
459449
460450 msg = self ._msg_option .format ("config-file" , config_file )
@@ -468,7 +458,6 @@ def _parse_config_file(self, config_file) -> Union[str, None]:
468458 return config_file
469459
470460 def _parse_parameter_file (self , parameter_file ) -> Union [None , str ]:
471-
472461 _msg_parameter_file = ""
473462 if len (parameter_file ) > 0 and not Path (parameter_file ).is_file ():
474463 parameter_file = None
@@ -492,7 +481,6 @@ def _parse_parameter_file(self, parameter_file) -> Union[None, str]:
492481 return parameter_file
493482
494483 def _parse_n_processes (self , n_processes ) -> int :
495-
496484 print (str_info (self ._msg_option .format ("n-processes" , n_processes )))
497485
498486 if n_processes <= 0 :
@@ -640,7 +628,6 @@ def run_import(self, pool: futures.ThreadPoolExecutor):
640628 # entry 0 is the reference run, thus we start at 1
641629 # pylint: disable = consider-using-enumerate
642630 for i_filepath in range (len (self .simulation_runs )):
643-
644631 # parameter file missing
645632 if self .parameter_file is None :
646633 if self .use_id_mapping :
@@ -691,7 +678,6 @@ def run_import(self, pool: futures.ThreadPoolExecutor):
691678 return_code_future .done () for return_code_future in return_code_futures
692679 )
693680 while n_imports_finished != len (return_code_futures ):
694-
695681 # check again
696682 n_new_imports_finished = sum (
697683 return_code_future .done () for return_code_future in return_code_futures
@@ -717,7 +703,6 @@ def run_import(self, pool: futures.ThreadPoolExecutor):
717703
718704 # print failure
719705 if any (return_code != 0 for return_code in return_codes ):
720-
721706 n_failed_runs = 0
722707 for i_run , return_code in enumerate (return_codes ):
723708 if return_code != 0 :
@@ -739,7 +724,6 @@ def run_import(self, pool: futures.ThreadPoolExecutor):
739724 # check log files
740725 messages = self .check_if_logfiles_show_success ("DFC_Import_*.log" )
741726 if messages :
742-
743727 # print failure
744728 msg = f"Running Imports ... done in { time .time () - start_time :.2f} s "
745729 print (str_error (msg ))
@@ -774,14 +758,12 @@ def run_math(self, pool: futures.ThreadPoolExecutor):
774758
775759 start_time = time .time ()
776760 return_code_future = pool .submit (
777- run_subprocess ,
778- [self .diffcrash_home / f"DFC_Math_{ self .crash_code } " , self .project_dir ],
761+ run_subprocess , [self .diffcrash_home / f"DFC_Math_{ self .crash_code } " , self .project_dir ]
779762 )
780763 return_code = return_code_future .result ()
781764
782765 # check return code
783766 if return_code != 0 :
784-
785767 msg = f"Running Math ... done in { time .time () - start_time :.2f} s "
786768 print (str_error (msg ))
787769 self .logger .error (msg )
@@ -793,7 +775,6 @@ def run_math(self, pool: futures.ThreadPoolExecutor):
793775 # check logs
794776 messages = self .check_if_logfiles_show_success ("DFC_MATH*.log" )
795777 if messages :
796-
797778 # print failure
798779 msg = f"Running Math ... done in { time .time () - start_time :.2f} s "
799780 print (str_error (msg ))
@@ -889,7 +870,6 @@ def run_export(self, pool: futures.ThreadPoolExecutor):
889870 # check logs
890871 messages = self .check_if_logfiles_show_success ("DFC_Export_*" )
891872 if messages :
892-
893873 # print failure
894874 msg = f"Running Export ... done in { time .time () - start_time :.2f} s "
895875 print (str_error (msg ))
@@ -900,10 +880,7 @@ def run_export(self, pool: futures.ThreadPoolExecutor):
900880 print (str_error (msg ))
901881 self .logger .error (msg )
902882
903- msg = (
904- "At least one export failed. "
905- f"Please check the log files in '{ self .logfile_dir } '."
906- )
883+ msg = f"At least one export failed. Please check the log files in '{ self .logfile_dir } '."
907884 self .logger .error (msg )
908885 raise RuntimeError (str_error (msg ))
909886
@@ -945,7 +922,6 @@ def run_matrix(self, pool: futures.ThreadPoolExecutor):
945922
946923 # check return code
947924 if return_code != 0 :
948-
949925 # print failure
950926 msg = f"Running Matrix ... done in { time .time () - start_time :.2f} s "
951927 print (str_error (msg ))
@@ -958,7 +934,6 @@ def run_matrix(self, pool: futures.ThreadPoolExecutor):
958934 # check log file
959935 messages = self .check_if_logfiles_show_success ("DFC_Matrix_*" )
960936 if messages :
961-
962937 # print failure
963938 msg = f"Running Matrix ... done in { time .time () - start_time :.2f} s "
964939 print (str_error (msg ))
@@ -1021,7 +996,6 @@ def run_eigen(self, pool: futures.ThreadPoolExecutor):
1021996 # check log file
1022997 messages = self .check_if_logfiles_show_success ("DFC_Matrix_*" )
1023998 if messages :
1024-
1025999 # print failure
10261000 msg = f"Running Eigen ... done in { time .time () - start_time :.2f} s "
10271001 print (str_error (msg ))
0 commit comments