Skip to content

Commit 9b23c1a

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

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.github/workflows/build-docs.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ jobs:
1414
deploy:
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Check out website
18+
uses: actions/checkout@v4
19+
with:
20+
path: website-draft
21+
fetch-depth: 0
1722
- name: Check out submissions
1823
uses: actions/checkout@master
1924
with:
2025
fetch-depth: 0
2126
repository: scicode-bench/submissions
22-
- name: Check out website
23-
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0
27+
path: submissions
28+
- name: Verify directory structure
29+
run: |
30+
sudo apt-get install tree
31+
tree -d .
2632
- name: Configure Git Credentials
2733
run: |
2834
git config user.name github-actions[bot]
@@ -45,6 +51,9 @@ jobs:
4551
pwd
4652
ls
4753
uv pip install --python ${Python_ROOT_DIR} -r 'requirements.txt'
54+
- name: Verify directory structure
55+
run: |
56+
tree -d ../../
4857
- name: Building leaderboard
4958
run: python leaderboard/create_leaderboard.py --input ../submissions --output docs/leaderboard_table.md
5059
- 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)