Skip to content

Commit 4983d9b

Browse files
committed
add one call to test plot.py
Signed-off-by: luarss <jluar@precisioninno.com>
1 parent 16eaf0f commit 4983d9b

File tree

1 file changed

+8
-1
lines changed
  • tools/AutoTuner/src/autotuner/utils

1 file changed

+8
-1
lines changed

tools/AutoTuner/src/autotuner/utils/plot.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
import pandas as pd
55
import matplotlib.pyplot as plt
66
import re
7+
import os
78
import argparse
89

910
AT_REGEX = r"variant-AutoTunerBase-([\w-]+)-\w+"
11+
IMG_DIR = "images"
1012

1113

1214
def load_dir(dir: str) -> pd.DataFrame:
@@ -83,6 +85,8 @@ def plot(df: pd.DataFrame, key: str):
8385

8486

8587
def main(results_dir: str):
88+
# Default: saves to <REPO_ROOT>/images. Change the IMG_DIR above.
89+
os.makedirs(IMG_DIR, exist_ok=True)
8690
df = load_dir(results_dir)
8791
df = preprocess(df)
8892
keys = ["qor", "runtime", "clk_period", "worst_slack"]
@@ -93,7 +97,10 @@ def main(results_dir: str):
9397
if __name__ == "__main__":
9498
parser = argparse.ArgumentParser(description="Plot AutoTuner results.")
9599
parser.add_argument(
96-
"results_dir", type=str, help="Directory containing the results.", required=True
100+
"--results_dir",
101+
type=str,
102+
help="Directory containing the results.",
103+
required=True,
97104
)
98105
args = parser.parse_args()
99106
main(args.results_dir)

0 commit comments

Comments
 (0)