Skip to content

Commit 1150cb0

Browse files
committed
updaye
1 parent a6c7359 commit 1150cb0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

benchmarks/run_all.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import glob
22
import os
33
import subprocess
4+
45
import pandas as pd
56

7+
68
PATTERN = "benchmarking_*.py"
79
FINAL_CSV_FILENAME = "collated_results.py"
810
GITHUB_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)}` failed with:\n{e.output.decode()}"
23-
) from e
23+
raise SubprocessCallException(f"Command `{' '.join(command)}` failed with:\n{e.output.decode()}") from e
2424

2525

2626
def 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}.csv"
@@ -73,3 +73,7 @@ def run_scripts():
7373
merge_csvs(final_csv=FINAL_CSV_FILENAME)
7474

7575
print(f"\nAll scripts attempted. Final collated CSV: {FINAL_CSV_FILENAME}")
76+
77+
78+
if __name__ == "__main__":
79+
run_scripts()

0 commit comments

Comments
 (0)