Skip to content

Commit 461ce15

Browse files
Alekh MekaAlekh Meka
authored andcommitted
Final updates to scripts
1 parent 9d0c828 commit 461ce15

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

artifacts/experiments/RQ4/generateResults.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
import subprocess
31
import os
42
import datetime
53
import re
@@ -8,7 +6,7 @@
86
import pandas as pd
97

108
BASE_RESULT_DIR = "artifacts/results/"
11-
PROJECTS = ["jflex", "mph-table"]
9+
PROJECTS = ["jflex", "convex", "mph-table"]
1210
REPORT_NAME = "artifacts/output/rq4.csv"
1311
TEX_REPORT_NAME = "artifacts/output/rq4.tex"
1412

@@ -18,8 +16,8 @@ def obtain_stats_directories(results_directory: str) -> list[str]:
1816

1917
def filter_for_recent_results(project_name: str, stats_directories: list[str]) -> dict[str, str]:
2018
valid_directories = []
21-
project_string = project_name if project_name != "convex" else project_name + "-core"
22-
if "mph-table-fixed" in stats_directories[0]:
19+
project_string = project_name if project_name != "convex" else project_name + "-core" # edge case
20+
if "mph-table-fixed" in stats_directories[0]: # edge case
2321
project_string = "mph-table-fixed"
2422
time_stamps = [datetime.datetime.strptime(x.replace(project_string, "").replace("_", ":").replace("T", " "), "%Y-%m-%d %H:%M:%S.%f")
2523
for x in stats_directories]
@@ -58,7 +56,6 @@ def retrieve_time_elapsed(directory_path: str, valid_htmls: list[str]) -> dict[s
5856
return times_elapsed_dict
5957

6058
def generate_report_stats(stat_values: dict[str, dict]) -> dict[str, str]:
61-
print(stat_values)
6259
first_iteration = stat_values[next(iter(stat_values))]
6360
# stage a dictionary to contain an array of times for ea property
6461
property_dict = {}
@@ -82,14 +79,13 @@ def generate_report_stats(stat_values: dict[str, dict]) -> dict[str, str]:
8279

8380

8481
def generate_project_report(project_name: str, final_stats: dict[str, str], final_fixed_stats: dict[str, str]) -> dict[str, dict]:
85-
final_report_dict = {}
86-
final_report_dict[project_name] = final_stats
87-
final_report_dict[project_name + "-fixed"] = final_fixed_stats
82+
final_report_dict = {project_name: final_stats, project_name + "-fixed": final_fixed_stats}
8883
return final_report_dict
8984

9085

9186
def main():
9287
final_report = {}
88+
df_dict = {}
9389
for project_name in PROJECTS:
9490
print("Starting " + project_name)
9591
fixed_project_name = project_name + "-fixed"
@@ -109,12 +105,17 @@ def main():
109105
final_stats = generate_report_stats(stat_values=raw_stats)
110106
final_fixed_stats = generate_report_stats(stat_values=fixed_raw_stats)
111107
report = generate_project_report(project_name=project_name, final_stats=final_stats, final_fixed_stats=final_fixed_stats)
108+
df_dict[project_name] = report
112109
final_report.update(report)
113110
print("Completed " + project_name)
114-
df = pd.DataFrame(final_report).reset_index()
115-
df.to_csv(path_or_buf=REPORT_NAME)
116-
df.style.to_latex(buf=TEX_REPORT_NAME)
117-
118-
111+
# print(final_report)
112+
# df = pd.DataFrame(final_report).reset_index()
113+
# df.to_csv(path_or_buf=REPORT_NAME)
114+
# df.style.to_latex(buf=TEX_REPORT_NAME)
115+
116+
for key, val in df_dict.items():
117+
df = pd.DataFrame(val).reset_index()
118+
df.to_csv(path_or_buf="artifacts/output/" + key + "_rq4.csv")
119+
df.style.to_latex(buf="artifacts/output/" + key + "_rq4.tex")
119120
if __name__ == "__main__":
120121
main()

run_experiment_rq4.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
GEN_STATS="artifacts/experiments/RQ4/generateStats.py"
2+
GEN_RESULTS="artifacts/experiments/RQ4/generateResults.py"
23
for PROJECT in mph-table convex jflex
34
do
45
echo Generating statistics for $PROJECT
56
python3 $GEN_STATS $PROJECT
6-
done
7+
done
8+
echo Generating results for projects
9+
python3 $GEN_RESULTS

0 commit comments

Comments
 (0)