@@ -185,17 +185,18 @@ def render_mds(overwrite_previous, subfolder="docs"):
185
185
"lite" : 3628 ,
186
186
"all" : 140926 ,
187
187
} # hard-coded to skip running it later
188
- for split in tqdm . tqdm ( ["lite" , "all" ]) :
188
+ for split in ["lite" , "all" ]:
189
189
num_repos = len (SPLIT [split ])
190
190
# total_num_tests = 0
191
191
# for repo_name in SPLIT[split]:
192
192
# repo_tests = subprocess.run(['commit0', 'get-tests', repo_name], capture_output=True, text=True).stdout.strip()
193
193
# total_num_tests += len(repo_tests.splitlines())
194
- leaderboard [split ] = leaderboard_header .format (
194
+ leaderboard [split ] = []
195
+ leaderboard [split ].append ((split_to_total_tests [split ]+ 1 , leaderboard_header .format (
195
196
split = split ,
196
197
num_repos = num_repos ,
197
198
total_num_tests = split_to_total_tests [split ],
198
- )
199
+ )))
199
200
200
201
for org_path in tqdm .tqdm (glob .glob (os .path .join (analysis_files_path , "*" ))):
201
202
org_name = os .path .basename (org_path )
@@ -322,19 +323,23 @@ def render_mds(overwrite_previous, subfolder="docs"):
322
323
wf .write (back_button + "\n " + submission_page )
323
324
analysis_link = f"[Analysis](/{ f'analysis_{ org_name } _{ branch_name } ' } )"
324
325
github_link = f"[Github]({ project_page_link } )"
325
- leaderboard [split ] += (
326
+ leaderboard [split ]. append (( cum_tests_passed ,
326
327
f"\n |{ display_name } |"
327
328
f"{ repos_resolved } |"
328
329
f"{ cum_tests_passed } |"
329
330
f"{ total_duration :.2f} |"
330
331
f"{ submission_date } |"
331
332
f"{ analysis_link } |"
332
333
f"{ github_link } |"
333
- )
334
+ ))
334
335
335
336
leaderboard_filepath = os .path .join (subfolder , "analysis.md" )
337
+ for split in ["lite" , "all" ]:
338
+ leaderboard [split ] = sorted (leaderboard [split ], key = lambda elt : - elt [0 ])
336
339
with open (leaderboard_filepath , "w" ) as wf :
337
- wf .write (leaderboard ["lite" ] + "\n \n " + leaderboard ["all" ])
340
+ lite_leaderboard_string = "" .join (string for (_ , string ) in leaderboard ["lite" ])
341
+ all_leaderboard_string = "" .join (string for (_ , string ) in leaderboard ["all" ])
342
+ wf .write (lite_leaderboard_string + "\n \n " + all_leaderboard_string )
338
343
339
344
340
345
def get_args ():
0 commit comments