calibrationcomp/calibration_benchmark
0
1---2title: Calibration Benchmark3emoji: ๐4colorFrom: red5colorTo: red6sdk: docker7app_port: 85018tags:9- streamlit10pinned: false11short_description: Streamlit template space12---13 14# Welcome to Streamlit!15 16Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:17 18If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community19forums](https://discuss.streamlit.io).20 21## Path to running the app locally (without docker)22Install the huggingface authentication (via `hf`) add security key23 24Use `python (e.g., 3.11)`25 26Then call27```28python3.11 -m venv .venv29pip install -r requirements.txt30```31 32As the data is just a pointer to the repository, install, and pull the large files33```34sudo apt install git-lfs35git lfs pull36```37then run the streamlit app38```39streamlit run src/streamlit_app.py40```41 42## Via docker (untested)43 44install docker45```46sudo snap install docker47docker build -t calibration-benchmark .48docker run -p 8501:8501 calibration-benchmark49```50Open51```52http://localhost:850153```54 55## Adding new data files (git LFS)56 57All `*.nc` files in `data/` are tracked via git LFS (configured in `.gitattributes`).58To add a new result file:59 60**Step 1 โ Ensure git LFS is installed and initialised**61```62sudo apt install git-lfs # or: brew install git-lfs63git lfs install64```65 66**Step 2 โ Copy the file into `data/`**67```68cp /path/to/your_results.nc data/your_results.nc69```70Sub-directories are fine (`data/UKI_results/`, `data/bayesian/`, etc.).71 72**Step 3 โ Stage and commit โ LFS handles the rest**73```74git add data/your_results.nc75git commit -m "Add <method> results for <benchmark>"76```77Git LFS intercepts the add automatically because `.gitattributes` already contains78`*.nc filter=lfs diff=lfs merge=lfs -text`. You can verify the file is tracked with:79```80git lfs ls-files | grep your_results.nc81```82 83**Step 4 โ Register the file in the app**84 85Open `src/data_store.py` and add the path to `DATASET_FILES` (optimization) or86`UQ_DATASET_FILES` (UQ leaderboard):87```python88DATASET_FILES = {89 "L96": [90 "existing_file.nc",91 "your_results.nc", # <-- add here92 ],93 ...94}95```96Paths are relative to the `data/` directory.97 98**Step 5 โ Push**99```100git push101```102LFS objects are pushed to the LFS store automatically alongside the pointer commit.103Collaborators get the data with `git lfs pull` after cloning or fetching.104 105---106 107## Contributing via a Hugging Face pull request108 109Hugging Face Spaces uses a non-standard PR workflow: you create the PR online first, then push to the branch it creates.110 111**Step 1 โ Clone the repo (if you haven't already)**112```113git clone https://huggingface.co/spaces/<owner>/<space-name>114cd <space-name>115```116 117**Step 2 โ Create and work on a local branch**118```119git checkout -b <local-branch-name>120```121Make your changes, then commit them:122```123git add <changed-files>124git commit -m "Your commit message"125```126 127**Step 3 โ Open the pull request online**128 129Go to the Space on huggingface.co โ **Community** tab โ **New Pull Request**.130Fill in the title and description and submit. Hugging Face will create a remote PR branch131(shown on the PR page, e.g. `refs/pr/1` or a named branch).132 133**Step 4 โ Push your local branch to the PR branch**134```135git push --set-upstream origin <local-branch-name>:<pr-branch-name>136```137Replace `<pr-branch-name>` with the branch name shown on the HF PR page (often `refs/pr/N`).138 139The PR page will update automatically once the push lands.