odunbar's picture
initial UQ and Claude interface (#2)
43604b6
|
Raw
History Blame Contribute Delete
3.49 kB
metadata
title: Calibration Benchmark
emoji: πŸš€
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
  - streamlit
pinned: false
short_description: Streamlit template space

Welcome to Streamlit!

Edit /src/streamlit_app.py to customize this app to your heart's desire. :heart:

If you have any questions, checkout our documentation and community forums.

Path to running the app locally (without docker)

Install the huggingface authentication (via hf) add security key

Use python (e.g., 3.11)

Then call

python3.11 -m venv .venv
pip install -r requirements.txt

As the data is just a pointer to the repository, install, and pull the large files

sudo apt install git-lfs
git lfs pull

then run the streamlit app

streamlit run src/streamlit_app.py

Via docker (untested)

install docker

sudo snap install docker
docker build -t calibration-benchmark .
docker run -p 8501:8501 calibration-benchmark

Open

http://localhost:8501

Adding new data files (git LFS)

All *.nc files in data/ are tracked via git LFS (configured in .gitattributes). To add a new result file:

Step 1 β€” Ensure git LFS is installed and initialised

sudo apt install git-lfs   # or: brew install git-lfs
git lfs install

Step 2 β€” Copy the file into data/

cp /path/to/your_results.nc data/your_results.nc

Sub-directories are fine (data/UKI_results/, data/bayesian/, etc.).

Step 3 β€” Stage and commit β€” LFS handles the rest

git add data/your_results.nc
git commit -m "Add <method> results for <benchmark>"

Git LFS intercepts the add automatically because .gitattributes already contains *.nc filter=lfs diff=lfs merge=lfs -text. You can verify the file is tracked with:

git lfs ls-files | grep your_results.nc

Step 4 β€” Register the file in the app

Open src/data_store.py and add the path to DATASET_FILES (optimization) or UQ_DATASET_FILES (UQ leaderboard):

DATASET_FILES = {
    "L96": [
        "existing_file.nc",
        "your_results.nc",   # <-- add here
    ],
    ...
}

Paths are relative to the data/ directory.

Step 5 β€” Push

git push

LFS objects are pushed to the LFS store automatically alongside the pointer commit. Collaborators get the data with git lfs pull after cloning or fetching.


Contributing via a Hugging Face pull request

Hugging Face Spaces uses a non-standard PR workflow: you create the PR online first, then push to the branch it creates.

Step 1 β€” Clone the repo (if you haven't already)

git clone https://huggingface.co/spaces/<owner>/<space-name>
cd <space-name>

Step 2 β€” Create and work on a local branch

git checkout -b <local-branch-name>

Make your changes, then commit them:

git add <changed-files>
git commit -m "Your commit message"

Step 3 β€” Open the pull request online

Go to the Space on huggingface.co β†’ Community tab β†’ New Pull Request. Fill in the title and description and submit. Hugging Face will create a remote PR branch (shown on the PR page, e.g. refs/pr/1 or a named branch).

Step 4 β€” Push your local branch to the PR branch

git push --set-upstream origin <local-branch-name>:<pr-branch-name>

Replace <pr-branch-name> with the branch name shown on the HF PR page (often refs/pr/N).

The PR page will update automatically once the push lands.