docs: add coding-agent Community PR steps
Browse files
README.md
CHANGED
|
@@ -147,6 +147,36 @@ upload with `--revision refs/pr/N` (do not pass `--create-pr` again).
|
|
| 147 |
Merge is on the
|
| 148 |
[Community tab](https://huggingface.co/datasets/bobleesj/quantem-data/discussions).
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
If a notebook should call `quantem.widget.datasets`, open a GitHub PR after
|
| 151 |
this one merges:
|
| 152 |
[Contribute tutorial data](https://github.com/electronmicroscopy/quantem.widget/blob/main/docs/tutorials/contribute_data.md).
|
|
|
|
| 147 |
Merge is on the
|
| 148 |
[Community tab](https://huggingface.co/datasets/bobleesj/quantem-data/discussions).
|
| 149 |
|
| 150 |
+
### Coding agents
|
| 151 |
+
|
| 152 |
+
A coding agent can open the Community pull request. The human creates the
|
| 153 |
+
Write token and attests permission. The agent does not invent
|
| 154 |
+
`permission.*`, `sampling`, or optics. The agent does not run
|
| 155 |
+
`hf auth login` (that prompt is interactive). The agent does not write the
|
| 156 |
+
token into a repository file.
|
| 157 |
+
|
| 158 |
+
```bash
|
| 159 |
+
# human already ran `hf auth login` or exported HF_TOKEN (Write)
|
| 160 |
+
hf auth whoami
|
| 161 |
+
hf download bobleesj/quantem-data --repo-type dataset \
|
| 162 |
+
--include "check_meta/**" --include "templates/meta.json" \
|
| 163 |
+
--local-dir ./quantem-data-tools
|
| 164 |
+
export PYTHONPATH="$PWD/quantem-data-tools${PYTHONPATH:+:$PYTHONPATH}"
|
| 165 |
+
python -m check_meta ./gold-512-bin4
|
| 166 |
+
hf upload bobleesj/quantem-data ./gold-512-bin4 \
|
| 167 |
+
widget-tutorials/show4dstem/gold-512-bin4/full \
|
| 168 |
+
--repo-type dataset --create-pr \
|
| 169 |
+
--commit-message "add show4dstem gold-512-bin4 full tutorial data"
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
`hf auth whoami` must print a username. If it fails or `--create-pr`
|
| 173 |
+
returns 403, stop and ask the human for a Write token (`export HF_TOKEN=...`).
|
| 174 |
+
If `python -m check_meta` is not `ok`, stop. After the upload, give the
|
| 175 |
+
human the Community URL. Do not merge.
|
| 176 |
+
|
| 177 |
+
Copyable widget prompt:
|
| 178 |
+
[Add tutorial data](https://github.com/electronmicroscopy/quantem.widget/blob/main/docs/agent-prompts.md#add-tutorial-data-hugging-face-pull-request).
|
| 179 |
+
|
| 180 |
If a notebook should call `quantem.widget.datasets`, open a GitHub PR after
|
| 181 |
this one merges:
|
| 182 |
[Contribute tutorial data](https://github.com/electronmicroscopy/quantem.widget/blob/main/docs/tutorials/contribute_data.md).
|