Skip to content

Commit 967a55b

Browse files
committed
fix some counting
1 parent 22b1f98 commit 967a55b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/render_submissions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def render_mds(subfolder="docs"):
253253
method_to_repos[branch_name] = """
254254
| | Repository | Summary | |
255255
|-|------------|---------|-|"""
256-
total_tests = 0 # better info is probably broken down by split lol TODO
257256
total_duration = 0.0
258257
for repo_name, repo_test_info in branch_info.items():
259258
for testname, test_info in repo_test_info.items():
@@ -272,18 +271,18 @@ def render_mds(subfolder="docs"):
272271
cum_pytests[category] += int(count)
273272
elif isinstance(count, float):
274273
cum_pytests[category] += float(count)
275-
total_tests += 1
276274
method_to_repos[branch_name] += (
277275
f"\n||[{repo_name}]({f'analysis_{branch_name}_{repo_name}'})|"
278276
f"{summary_pytests_string}||"
279277
)
280278
break # assume we ran all tests. will add functionality for checking diff tests later, as we need it.
281279
summary_pytests_string = (
282-
f"{cum_pytests['passed']} / {total_tests} ; duration: {total_duration:.2f}s"
280+
f"{cum_pytests['passed']} / {cum_pytests['collected']} ; duration: {total_duration:.2f}s"
283281
)
284282
leaderboard += f"\n||[{branch_name}]({f'analysis_{branch_name}'})|{summary_pytests_string}||"
283+
back_button = f"[back to all submissions]({f'analysis'})\n\n"
285284
with open(os.path.join(subfolder, f"analysis_{branch_name}.md"), "w") as wf:
286-
wf.write(method_to_repos[branch_name])
285+
wf.write(back_button + "\n" + method_to_repos[branch_name])
287286
with open(os.path.join(subfolder, "analysis.md"), "w") as wf:
288287
wf.write(leaderboard)
289288

@@ -387,9 +386,10 @@ def main(args):
387386
)
388387
if not args.keep_previous_eval:
389388
for subfolder in glob.glob(os.path.join(analysis_files_path, "*")):
390-
if os.path.basename(subfolder) not in {"blank", "reference", "repos", "submission_repos"}:
389+
if os.path.basename(subfolder.rstrip("/")) not in {"blank", "reference", "repos", "submission_repos"}:
391390
try:
392-
shutil.rmtree(analysis_files_path, subfolder)
391+
print(f"Clearing {subfolder}")
392+
shutil.rmtree(subfolder)
393393
except Exception as e:
394394
print(f"{e}: when removing {subfolder}")
395395

0 commit comments

Comments
 (0)