Skip to content

Commit

Permalink
Double check that we have the right directory
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Jul 12, 2024
1 parent d2f2ff3 commit c5f959f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out website
uses: actions/checkout@v4
with:
path: website-draft
fetch-depth: 0
- name: Check out submissions
uses: actions/checkout@master
with:
fetch-depth: 0
repository: scicode-bench/submissions
- name: Check out website
uses: actions/checkout@v4
with:
fetch-depth: 0
path: submissions
- name: Verify directory structure
run: |
sudo apt-get install tree
tree -d .
- name: Change into right directory
run: cd website-draft
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
Expand All @@ -45,6 +53,9 @@ jobs:
pwd
ls
uv pip install --python ${Python_ROOT_DIR} -r 'requirements.txt'
- name: Verify directory structure
run: |
tree -d ../../
- name: Building leaderboard
run: python leaderboard/create_leaderboard.py --input ../submissions --output docs/leaderboard_table.md
- name: Build Documentation
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Scicode website

## Building it

```bash

```
10 changes: 9 additions & 1 deletion leaderboard/create_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import dataclasses
from multiprocessing import Value
from pathlib import Path
import pandas as pd
import json
Expand Down Expand Up @@ -48,7 +49,14 @@ def to_file(self, path: Path, score="default"):

def main(input: str, output: str) -> None:
la = LeaderboardAggregator()
for inpt in Path(input).rglob("score.json"):
if not Path(input).is_dir():
msg = "Input must be an existing directory"
raise ValueError(msg)
score_files = Path(input).rglob("score.json")
if not score_files:
msg = "No score files found"
raise ValueError(msg)
for inpt in score_files:
print("Loading", inpt)
la.load_file(inpt)
la.to_file(Path(output))
Expand Down

0 comments on commit c5f959f

Please sign in to comment.