11import  glob 
22import  os 
33import  subprocess 
4+ 
45import  pandas  as  pd 
56
7+ 
68PATTERN  =  "benchmarking_*.py" 
79FINAL_CSV_FILENAME  =  "collated_results.py" 
810GITHUB_SHA  =  os .getenv ("GITHUB_SHA" , None )
@@ -18,9 +20,7 @@ def run_command(command: list[str], return_stdout=False):
1820        if  return_stdout  and  hasattr (output , "decode" ):
1921            return  output .decode ("utf-8" )
2022    except  subprocess .CalledProcessError  as  e :
21-         raise  SubprocessCallException (
22-             f"Command `{ ' ' .join (command )} \n { e .output .decode ()}  
23-         ) from  e 
23+         raise  SubprocessCallException (f"Command `{ ' ' .join (command )} \n { e .output .decode ()}  ) from  e 
2424
2525
2626def  merge_csvs (final_csv : str  =  "collated_results.csv" ):
@@ -54,7 +54,7 @@ def run_scripts():
5454    python_files  =  [f  for  f  in  python_files  if  f  !=  "benchmarking_utils.py" ]
5555
5656    for  file  in  python_files :
57-         script_name  =  file .split (".py" )[0 ].split ("_" )[- 1 ] # example: benchmarking_foo.py -> foo 
57+         script_name  =  file .split (".py" )[0 ].split ("_" )[- 1 ]   # example: benchmarking_foo.py -> foo 
5858        print (f"\n ****** Running file: { file }  )
5959
6060        partial_csv  =  f"{ script_name }  
@@ -73,3 +73,7 @@ def run_scripts():
7373            merge_csvs (final_csv = FINAL_CSV_FILENAME )
7474
7575    print (f"\n All scripts attempted. Final collated CSV: { FINAL_CSV_FILENAME }  )
76+ 
77+ 
78+ if  __name__  ==  "__main__" :
79+     run_scripts ()
0 commit comments