Update
Browse files- app.py +19 -0
- src/leaderboard/read_evals.py +5 -0
app.py
CHANGED
@@ -77,6 +77,7 @@ for cat, bug_ids in bug_id_by_cat.items():
|
|
77 |
timeline_bugids.append(bug_id)
|
78 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_REQUESTS_PATH, total_issues)
|
79 |
fixed_bug_ids = set()
|
|
|
80 |
for row in LEADERBOARD_DF.itertuples():
|
81 |
print(row)
|
82 |
model_cnt += 1
|
@@ -85,6 +86,8 @@ for row in LEADERBOARD_DF.itertuples():
|
|
85 |
timeline_cols.append(row.method_id)
|
86 |
timeline_bugids.append(fix)
|
87 |
fixed_bug_ids.add(fix)
|
|
|
|
|
88 |
timeline_bugtypes = []
|
89 |
for bug_id in timeline_bugids:
|
90 |
timeline_xs.append(bug_id_to_time[bug_id])
|
@@ -99,10 +102,14 @@ timeline_df = pd.DataFrame(
|
|
99 |
}
|
100 |
)
|
101 |
fixed_by_cat = dict()
|
|
|
102 |
for bug_id in fixed_bug_ids:
|
103 |
fixed_by_cat[bug_id_to_type[bug_id]] = fixed_by_cat.get(bug_id_to_type[bug_id], 0) + 1
|
|
|
|
|
104 |
fixed_by_cat["All"] = len(fixed_bug_ids)
|
105 |
bug_id_by_cat["All"] = [0] * total_issues
|
|
|
106 |
fixed_by_cat_df = pd.DataFrame(
|
107 |
{
|
108 |
"Category": [str(cat).capitalize() for cat in fixed_by_cat.keys()],
|
@@ -111,6 +118,10 @@ fixed_by_cat_df = pd.DataFrame(
|
|
111 |
"Repair Rate (%)": [
|
112 |
round(fixed_by_cat[cat] / len(bug_id_by_cat[cat]) * 100, 1) for cat in fixed_by_cat.keys()
|
113 |
],
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
)
|
116 |
fixed_by_cat_df.sort_values("Total", inplace=True, ascending=False)
|
@@ -118,6 +129,10 @@ fixed_by_comp = dict()
|
|
118 |
for bug_id in fixed_bug_ids:
|
119 |
for comp in bug_id_to_comp[bug_id]:
|
120 |
fixed_by_comp[comp] = fixed_by_comp.get(comp, 0) + 1
|
|
|
|
|
|
|
|
|
121 |
fixed_by_comp_df = pd.DataFrame(
|
122 |
{
|
123 |
"Component": list(comp_bug_count.keys()),
|
@@ -126,6 +141,10 @@ fixed_by_comp_df = pd.DataFrame(
|
|
126 |
"Repair Rate (%)": [
|
127 |
round(fixed_by_comp.get(comp, 0) / comp_bug_count[comp] * 100, 1) for comp in comp_bug_count.keys()
|
128 |
],
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
)
|
131 |
fixed_by_comp_df.sort_values("Total", inplace=True, ascending=False)
|
|
|
77 |
timeline_bugids.append(bug_id)
|
78 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_REQUESTS_PATH, total_issues)
|
79 |
fixed_bug_ids = set()
|
80 |
+
fixed_bug_ids_fast = set()
|
81 |
for row in LEADERBOARD_DF.itertuples():
|
82 |
print(row)
|
83 |
model_cnt += 1
|
|
|
86 |
timeline_cols.append(row.method_id)
|
87 |
timeline_bugids.append(fix)
|
88 |
fixed_bug_ids.add(fix)
|
89 |
+
for fix in row.fixed_bug_ids_fast:
|
90 |
+
fixed_bug_ids_fast.add(fix)
|
91 |
timeline_bugtypes = []
|
92 |
for bug_id in timeline_bugids:
|
93 |
timeline_xs.append(bug_id_to_time[bug_id])
|
|
|
102 |
}
|
103 |
)
|
104 |
fixed_by_cat = dict()
|
105 |
+
fixed_by_cat_fast = dict()
|
106 |
for bug_id in fixed_bug_ids:
|
107 |
fixed_by_cat[bug_id_to_type[bug_id]] = fixed_by_cat.get(bug_id_to_type[bug_id], 0) + 1
|
108 |
+
for bug_id in fixed_bug_ids_fast:
|
109 |
+
fixed_by_cat_fast[bug_id_to_type[bug_id]] = fixed_by_cat_fast.get(bug_id_to_type[bug_id], 0) + 1
|
110 |
fixed_by_cat["All"] = len(fixed_bug_ids)
|
111 |
bug_id_by_cat["All"] = [0] * total_issues
|
112 |
+
fixed_by_cat_fast["All"] = len(fixed_bug_ids_fast)
|
113 |
fixed_by_cat_df = pd.DataFrame(
|
114 |
{
|
115 |
"Category": [str(cat).capitalize() for cat in fixed_by_cat.keys()],
|
|
|
118 |
"Repair Rate (%)": [
|
119 |
round(fixed_by_cat[cat] / len(bug_id_by_cat[cat]) * 100, 1) for cat in fixed_by_cat.keys()
|
120 |
],
|
121 |
+
"Repaired (Fast)": [fixed_by_cat_fast.get(cat, 0) for cat in fixed_by_cat.keys()],
|
122 |
+
"Repair Rate (Fast) (%)": [
|
123 |
+
round(fixed_by_cat_fast.get(cat, 0) / len(bug_id_by_cat[cat]) * 100, 1) for cat in fixed_by_cat.keys()
|
124 |
+
],
|
125 |
}
|
126 |
)
|
127 |
fixed_by_cat_df.sort_values("Total", inplace=True, ascending=False)
|
|
|
129 |
for bug_id in fixed_bug_ids:
|
130 |
for comp in bug_id_to_comp[bug_id]:
|
131 |
fixed_by_comp[comp] = fixed_by_comp.get(comp, 0) + 1
|
132 |
+
fixed_by_comp_fast = dict()
|
133 |
+
for bug_id in fixed_bug_ids_fast:
|
134 |
+
for comp in bug_id_to_comp[bug_id]:
|
135 |
+
fixed_by_comp_fast[comp] = fixed_by_comp_fast.get(comp, 0) + 1
|
136 |
fixed_by_comp_df = pd.DataFrame(
|
137 |
{
|
138 |
"Component": list(comp_bug_count.keys()),
|
|
|
141 |
"Repair Rate (%)": [
|
142 |
round(fixed_by_comp.get(comp, 0) / comp_bug_count[comp] * 100, 1) for comp in comp_bug_count.keys()
|
143 |
],
|
144 |
+
"Repaired (Fast)": [fixed_by_comp_fast.get(comp, 0) for comp in comp_bug_count.keys()],
|
145 |
+
"Repair Rate (Fast) (%)": [
|
146 |
+
round(fixed_by_comp_fast.get(comp, 0) / comp_bug_count[comp] * 100, 1) for comp in comp_bug_count.keys()
|
147 |
+
],
|
148 |
}
|
149 |
)
|
150 |
fixed_by_comp_df.sort_values("Total", inplace=True, ascending=False)
|
src/leaderboard/read_evals.py
CHANGED
@@ -27,6 +27,7 @@ class EvalResult:
|
|
27 |
mttr: float
|
28 |
sample_count: float
|
29 |
fixed_bug_ids: list[str]
|
|
|
30 |
|
31 |
@classmethod
|
32 |
def init_from_json_file(self, json_filepath):
|
@@ -48,11 +49,13 @@ class EvalResult:
|
|
48 |
build_failure_count = 0
|
49 |
ttr_sum = 0
|
50 |
fixed_bug_ids = []
|
|
|
51 |
sample_count = 0
|
52 |
for fix in fixes:
|
53 |
bug_type = fix.get("bug_type", "")
|
54 |
if fix.get("fast_check_pass", False):
|
55 |
fast_pass_count += 1
|
|
|
56 |
if fix.get("full_check_pass", False):
|
57 |
full_pass_count += 1
|
58 |
full_pass_count_cat[bug_type] = full_pass_count_cat.get(bug_type, 0) + 1
|
@@ -78,6 +81,7 @@ class EvalResult:
|
|
78 |
build_failure_count=build_failure_count,
|
79 |
mttr=round(ttr_sum / full_pass_count / 60, 1) if full_pass_count > 0 else 0,
|
80 |
fixed_bug_ids=fixed_bug_ids,
|
|
|
81 |
sample_count=round(sample_count / full_pass_count, 1) if full_pass_count > 0 else 0,
|
82 |
)
|
83 |
|
@@ -99,6 +103,7 @@ class EvalResult:
|
|
99 |
),
|
100 |
AutoEvalColumn.mttr.name: self.mttr,
|
101 |
"fixed_bug_ids": self.fixed_bug_ids,
|
|
|
102 |
"method_id": self.method_name + "(" + self.model_name + ")",
|
103 |
AutoEvalColumn.sample_count.name: self.sample_count,
|
104 |
}
|
|
|
27 |
mttr: float
|
28 |
sample_count: float
|
29 |
fixed_bug_ids: list[str]
|
30 |
+
fixed_bug_ids_fast: list[str]
|
31 |
|
32 |
@classmethod
|
33 |
def init_from_json_file(self, json_filepath):
|
|
|
49 |
build_failure_count = 0
|
50 |
ttr_sum = 0
|
51 |
fixed_bug_ids = []
|
52 |
+
fixed_bug_ids_fast = []
|
53 |
sample_count = 0
|
54 |
for fix in fixes:
|
55 |
bug_type = fix.get("bug_type", "")
|
56 |
if fix.get("fast_check_pass", False):
|
57 |
fast_pass_count += 1
|
58 |
+
fixed_bug_ids_fast.append(fix.get("bug_id", ""))
|
59 |
if fix.get("full_check_pass", False):
|
60 |
full_pass_count += 1
|
61 |
full_pass_count_cat[bug_type] = full_pass_count_cat.get(bug_type, 0) + 1
|
|
|
81 |
build_failure_count=build_failure_count,
|
82 |
mttr=round(ttr_sum / full_pass_count / 60, 1) if full_pass_count > 0 else 0,
|
83 |
fixed_bug_ids=fixed_bug_ids,
|
84 |
+
fixed_bug_ids_fast=fixed_bug_ids_fast,
|
85 |
sample_count=round(sample_count / full_pass_count, 1) if full_pass_count > 0 else 0,
|
86 |
)
|
87 |
|
|
|
103 |
),
|
104 |
AutoEvalColumn.mttr.name: self.mttr,
|
105 |
"fixed_bug_ids": self.fixed_bug_ids,
|
106 |
+
"fixed_bug_ids_fast": self.fixed_bug_ids_fast,
|
107 |
"method_id": self.method_name + "(" + self.model_name + ")",
|
108 |
AutoEvalColumn.sample_count.name: self.sample_count,
|
109 |
}
|