diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index 3bac20f..2cf4c40 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -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] @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8321981 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Scicode website + +## Building it + +```bash + +``` \ No newline at end of file diff --git a/leaderboard/create_leaderboard.py b/leaderboard/create_leaderboard.py index 5daccff..ac9cc61 100755 --- a/leaderboard/create_leaderboard.py +++ b/leaderboard/create_leaderboard.py @@ -2,6 +2,7 @@ import argparse import dataclasses +from multiprocessing import Value from pathlib import Path import pandas as pd import json @@ -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))