Skip to content

Commit a837427

Browse files
committed
[scoreboard] Fix for '?' in A and E columns
1 parent 63a5666 commit a837427

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scoreboard/main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@
9393

9494
perf_val = perf_stats.get(dir, {}).get(task_type, "?")
9595

96-
# Calculate efficiency if performance data is available
96+
# Calculate acceleration and efficiency if performance data is available
97+
acceleration = "?"
9798
efficiency = "?"
9899
try:
99100
perf_float = float(perf_val)
100101
if perf_float > 0:
101102
speedup = 1.0 / perf_float
103+
acceleration = f"{speedup:.2f}"
102104
efficiency = f"{speedup / eff_num_proc * 100:.2f}"
103105
except (ValueError, TypeError):
104106
pass
@@ -114,7 +116,11 @@
114116
"log",
115117
"-1",
116118
"--format=%ct",
117-
str(tasks_dir / (dir + ("_disabled" if status == "disabled" else "")) / task_type),
119+
str(
120+
tasks_dir
121+
/ (dir + ("_disabled" if status == "disabled" else ""))
122+
/ task_type
123+
),
118124
]
119125
result = subprocess.run(git_cmd, capture_output=True, text=True)
120126
if result.stdout.strip().isdigit():
@@ -130,6 +136,7 @@
130136
"solution_points": sol_points,
131137
"solution_style": solution_style,
132138
"perf": perf_val,
139+
"acceleration": acceleration,
133140
"efficiency": efficiency,
134141
"deadline_points": deadline_points,
135142
"plagiarised": is_cheated,

scoreboard/templates/index.html.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<td>{{ row.task }}</td>
3737
{% for cell in row.types %}
3838
<td style="text-align: center{% if cell.solution_style %};{{ cell.solution_style }}{% endif %}">{{ cell.solution_points }}</td>
39-
<td style="text-align: center;background-color: lavender;">{{ cell.perf }}</td>
39+
<td style="text-align: center;background-color: lavender;">{{ cell.acceleration }}</td>
4040
<td style="text-align: center;background-color: lavender;">{{ cell.efficiency }}</td>
4141
<td style="text-align: center;">{{ cell.deadline_points }}</td>
4242
<td style="text-align: center{% if cell.plagiarised %}; background-color: pink{% endif %}">{{ cell.plagiarism_points }}</td>

0 commit comments

Comments
 (0)