File size: 3,486 Bytes
53f9f3e
1a75d8b
53f9f3e
 
 
 
 
 
1a75d8b
53f9f3e
 
 
 
 
 
 
 
 
 
43604b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
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](https://docs.streamlit.io) and [community
forums](https://discuss.streamlit.io).

## 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):
```python
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.