Skip to content

Commit b6f75f5

Browse files
committed
Double check that we have the right directory
1 parent d2f2ff3 commit b6f75f5

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/build-docs.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121
repository: scicode-bench/submissions
22+
path: submissions
2223
- name: Check out website
2324
uses: actions/checkout@v4
2425
with:
@@ -45,6 +46,10 @@ jobs:
4546
pwd
4647
ls
4748
uv pip install --python ${Python_ROOT_DIR} -r 'requirements.txt'
49+
- name: Verify directory structure
50+
run: |
51+
sudo apt-get install tree
52+
tree -d
4853
- name: Building leaderboard
4954
run: python leaderboard/create_leaderboard.py --input ../submissions --output docs/leaderboard_table.md
5055
- name: Build Documentation

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Scicode website
2+
3+
## Building it
4+
5+
```bash
6+
7+
```

leaderboard/create_leaderboard.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import dataclasses
5+
from multiprocessing import Value
56
from pathlib import Path
67
import pandas as pd
78
import json
@@ -48,7 +49,14 @@ def to_file(self, path: Path, score="default"):
4849

4950
def main(input: str, output: str) -> None:
5051
la = LeaderboardAggregator()
51-
for inpt in Path(input).rglob("score.json"):
52+
if not Path(input).is_dir():
53+
msg = "Input must be an existing directory"
54+
raise ValueError(msg)
55+
score_files = Path(input).rglob("score.json")
56+
if not score_files:
57+
msg = "No score files found"
58+
raise ValueError(msg)
59+
for inpt in score_files:
5260
print("Loading", inpt)
5361
la.load_file(inpt)
5462
la.to_file(Path(output))

0 commit comments

Comments
 (0)