docs: host tutorial data agent prompt (#4)
Browse files- docs: host tutorial data agent prompt (ab12b62ebe5939715b931e196e2f5736a842634a)
- docs: make data PR prompt self-contained (421d2863b17b9886e800196ff6efffae27dc809b)
- README.md +68 -14
- templates/meta.json +7 -7
README.md
CHANGED
|
@@ -96,19 +96,21 @@ Processed float data uses `"float32"`. Read both values from the file
|
|
| 96 |
(`arr.shape`, `arr.dtype`, or the EMD image) and copy them into
|
| 97 |
`meta.json`.
|
| 98 |
|
|
|
|
|
|
|
| 99 |
```json
|
| 100 |
{
|
| 101 |
-
"name": "
|
| 102 |
-
"source": "
|
| 103 |
-
"date": "
|
| 104 |
-
"sample": "
|
| 105 |
"shape": [512, 512, 48, 48],
|
| 106 |
"dtype": "uint16",
|
| 107 |
"permission": {
|
| 108 |
"received": true,
|
| 109 |
-
"from": ["
|
| 110 |
-
"collectors": ["
|
| 111 |
-
"date": "
|
| 112 |
},
|
| 113 |
"sampling": [0.5, 0.5, 1.84, 1.84],
|
| 114 |
"units": ["A", "A", "mrad", "mrad"],
|
|
@@ -118,10 +120,11 @@ Processed float data uses `"float32"`. Read both values from the file
|
|
| 118 |
}
|
| 119 |
```
|
| 120 |
|
| 121 |
-
`source` is microscope, facility, and
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
share
|
|
|
|
| 125 |
|
| 126 |
```bash
|
| 127 |
python -m check_meta ./gold-512-bin4
|
|
@@ -171,8 +174,59 @@ returns 403, stop and ask the human for a Write token (`export HF_TOKEN=...`).
|
|
| 171 |
If `python -m check_meta` is not `ok`, stop. After the upload, give the
|
| 172 |
human the Community URL. Do not merge.
|
| 173 |
|
| 174 |
-
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
If a notebook should call `quantem.widget.datasets`, open a GitHub PR after
|
| 178 |
this one merges:
|
|
@@ -210,4 +264,4 @@ yourself. Put that receipt in `meta.json` (`permission.received`,
|
|
| 210 |
collected it yourself, set `from` and `collectors` to your name.
|
| 211 |
|
| 212 |
Do not open a pull request without that permission. `python -m check_meta`
|
| 213 |
-
must print `ok`.
|
|
|
|
| 96 |
(`arr.shape`, `arr.dtype`, or the EMD image) and copy them into
|
| 97 |
`meta.json`.
|
| 98 |
|
| 99 |
+
Replace every placeholder in this example:
|
| 100 |
+
|
| 101 |
```json
|
| 102 |
{
|
| 103 |
+
"name": "<public dataset name>",
|
| 104 |
+
"source": "<public-facing microscope, facility, and acquisition description>",
|
| 105 |
+
"date": "<YYYY-MM-DD>",
|
| 106 |
+
"sample": "<sample description>",
|
| 107 |
"shape": [512, 512, 48, 48],
|
| 108 |
"dtype": "uint16",
|
| 109 |
"permission": {
|
| 110 |
"received": true,
|
| 111 |
+
"from": ["<person who granted permission>"],
|
| 112 |
+
"collectors": ["<data collector>"],
|
| 113 |
+
"date": "<YYYY-MM-DD>"
|
| 114 |
},
|
| 115 |
"sampling": [0.5, 0.5, 1.84, 1.84],
|
| 116 |
"units": ["A", "A", "mrad", "mrad"],
|
|
|
|
| 120 |
}
|
| 121 |
```
|
| 122 |
|
| 123 |
+
`source` is a public-facing microscope, facility, and acquisition description;
|
| 124 |
+
omit local paths and non-public filenames. `date` is the acquisition day
|
| 125 |
+
(`YYYY-MM-DD`). `permission.received` must be `true`. `from` is who granted
|
| 126 |
+
the share (one name or several). `collectors` is who used the instrument
|
| 127 |
+
(one name or several). `permission.date` is when that share was granted.
|
| 128 |
|
| 129 |
```bash
|
| 130 |
python -m check_meta ./gold-512-bin4
|
|
|
|
| 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 |
+
Copy this prompt into your coding agent. Replace every placeholder before
|
| 178 |
+
submitting it. Do not paste a Hugging Face token into the prompt.
|
| 179 |
+
|
| 180 |
+
```text
|
| 181 |
+
Add these files to the public Hugging Face dataset bobleesj/quantem-data
|
| 182 |
+
as a Community pull request.
|
| 183 |
+
|
| 184 |
+
Local folder:
|
| 185 |
+
<path to a folder that already contains the data files and will get meta.json>
|
| 186 |
+
|
| 187 |
+
Target hub path:
|
| 188 |
+
widget-tutorials/<widget-or-shared>/<name>/<size>/
|
| 189 |
+
|
| 190 |
+
Permission (required; do not invent):
|
| 191 |
+
- I collected this data myself: <yes/no>
|
| 192 |
+
- permission.from: <name or list>
|
| 193 |
+
- permission.collectors: <name or list>
|
| 194 |
+
- permission.date: <YYYY-MM-DD>
|
| 195 |
+
- I have written permission from the collector: <yes, or "I collected it">
|
| 196 |
+
|
| 197 |
+
Follow the current Add data and Coding agents instructions on this dataset
|
| 198 |
+
card. Do not use quantem.widget.io.upload. Do not commit .npy or .emd into
|
| 199 |
+
electronmicroscopy/quantem.widget.
|
| 200 |
+
|
| 201 |
+
1. Confirm `hf auth whoami` prints a username. If it fails, stop and ask me
|
| 202 |
+
to create a Write token and run `hf auth login`, or export `HF_TOKEN`.
|
| 203 |
+
Do not run an interactive login yourself or write the token into a repo.
|
| 204 |
+
2. Download the checker and template, then copy the template into the folder:
|
| 205 |
+
|
| 206 |
+
hf download bobleesj/quantem-data --repo-type dataset \
|
| 207 |
+
--include "check_meta/**" --include "templates/meta.json" \
|
| 208 |
+
--local-dir ./quantem-data-tools
|
| 209 |
+
cp ./quantem-data-tools/templates/meta.json <folder>/meta.json
|
| 210 |
+
|
| 211 |
+
3. Fill every required field in `<folder>/meta.json` from the files and the
|
| 212 |
+
permission lines above. Read shape and dtype from the array or EMD. Omit
|
| 213 |
+
optional values when unknown; do not invent them. Do not put a local path
|
| 214 |
+
or credential in `meta.json`. Validate it:
|
| 215 |
+
|
| 216 |
+
export PYTHONPATH="$PWD/quantem-data-tools${PYTHONPATH:+:$PYTHONPATH}"
|
| 217 |
+
python -m check_meta <folder>
|
| 218 |
+
|
| 219 |
+
Stop unless validation prints `ok`.
|
| 220 |
+
4. Open the Community pull request:
|
| 221 |
+
|
| 222 |
+
hf upload bobleesj/quantem-data <folder> \
|
| 223 |
+
widget-tutorials/<widget-or-shared>/<name>/<size>/ \
|
| 224 |
+
--repo-type dataset --create-pr \
|
| 225 |
+
--commit-message "add <widget> <name> <size> tutorial data"
|
| 226 |
+
5. Give me the Community URL. Do not merge. Open a GitHub PR only if a named
|
| 227 |
+
loader is also needed in `quantem.widget.datasets`; that PR waits until
|
| 228 |
+
this Hugging Face PR merges. A new widget is discuss-first.
|
| 229 |
+
```
|
| 230 |
|
| 231 |
If a notebook should call `quantem.widget.datasets`, open a GitHub PR after
|
| 232 |
this one merges:
|
|
|
|
| 264 |
collected it yourself, set `from` and `collectors` to your name.
|
| 265 |
|
| 266 |
Do not open a pull request without that permission. `python -m check_meta`
|
| 267 |
+
must print `ok`.
|
templates/meta.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "
|
| 3 |
-
"source": "
|
| 4 |
-
"date": "
|
| 5 |
-
"sample": "
|
| 6 |
"shape": [512, 512, 48, 48],
|
| 7 |
"dtype": "uint16",
|
| 8 |
"permission": {
|
| 9 |
"received": true,
|
| 10 |
-
"from": ["
|
| 11 |
-
"collectors": ["
|
| 12 |
-
"date": "
|
| 13 |
},
|
| 14 |
"sampling": [0.5, 0.5, 1.84, 1.84],
|
| 15 |
"units": ["A", "A", "mrad", "mrad"],
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "<public dataset name>",
|
| 3 |
+
"source": "<public-facing microscope, facility, and acquisition description>",
|
| 4 |
+
"date": "<YYYY-MM-DD>",
|
| 5 |
+
"sample": "<sample description>",
|
| 6 |
"shape": [512, 512, 48, 48],
|
| 7 |
"dtype": "uint16",
|
| 8 |
"permission": {
|
| 9 |
"received": true,
|
| 10 |
+
"from": ["<person who granted permission>"],
|
| 11 |
+
"collectors": ["<data collector>"],
|
| 12 |
+
"date": "<YYYY-MM-DD>"
|
| 13 |
},
|
| 14 |
"sampling": [0.5, 0.5, 1.84, 1.84],
|
| 15 |
"units": ["A", "A", "mrad", "mrad"],
|