You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,17 @@ Two on-disk schemas carry the same information under different names. The rest o
33
33
34
34
1.**Welcome modal** — on every page load, the user picks a dataset before the app loads anything. Lists known HF datasets from `DATASETS` in [src/datasets.js](src/datasets.js), accepts a custom `user/dataset_name`, or accepts a local Arrow shard directory when self-hosting.
35
35
2.**URL override** — `?dataset=user/name` (optional `&config=`, `&split=`, `&label=`) prepends a synthetic descriptor and pre-selects it in the modal. Logic in `descriptorFromURL()` at the top of [src/App.jsx](src/App.jsx).
36
+
37
+
A descriptor's `split` may be a single name (`"train"`), an array, or `"*"` (every split, merged — see *The summary.json mechanism*). The custom-input and URL-override defaults are `"*"`, which gracefully reduces to whatever splits exist (a single-split dataset behaves exactly as before); pass `&split=train` to pin one. The bundled `ZTF_40k` entry uses `"*"` so all four splits (train/validation/test/anom, ~42.5k rows) load as one dataset.
36
38
3.**File picker** — disabled in deployed builds via `IS_DEPLOYED`. **Brittleness**: this currently checks `import.meta.env.BASE_URL !== '/'`, which works for the github.io subpath deploy but would falsely re-enable the picker for a custom-domain build (`BASE_PATH=/`). Switch to a dedicated env var like `VITE_DEPLOY_TARGET=pages` set only in the workflow if adding a custom domain.
37
39
38
40
## The summary.json mechanism
39
41
40
42
`HFDataSource.getSummary()` fetches a pre-computed summary from `https://huggingface.co/datasets/<repo>/resolve/main/summary.<split>.json`, falling back to `summary.json` if that 404s. **Without it the app degrades**: no sky map, no class filter, no class-balanced random sampling. Falls back gracefully to global random offset.
41
43
42
-
**Per-split naming matters**: `classIndices` holds split-specific row offsets that `getRows({ offset })` relies on, so a `train`-built summary must not be served when viewing another split. Multi-split datasets need one file per split (`summary.<split>.json`); the `summary.json` fallback keeps existing single-split datasets working unchanged.
44
+
**Per-split naming matters**: `classIndices` holds split-local row offsets that `getRows({ offset })` relies on, so a `train`-built summary must not be served when viewing another split. Multi-split datasets need one file per split (`summary.<split>.json`); the `summary.json` fallback keeps existing single-split datasets working unchanged.
45
+
46
+
**Merging splits into one view**: a descriptor's `split` may be a single name, an array, or `"*"` (every split in the config) — see *Dataset selection*. When more than one split is in play, `HFDataSource` treats them as one contiguous dataset: `getInfo` resolves the split list and computes per-split global base offsets (`_splitEnds`) from each split's `num_examples`; `getRows({ offset })` maps a global offset back to the owning split + local offset (`_splitForOffset`); and `getSummary` → `_mergeSummaries` fetches every `summary.<split>.json`, sums `classCounts`, concatenates `classIndices` **shifted by each split's global base** so they index the same concatenated space, unions `bands`, and re-runs `sampleSkyPointsByClass` over the pooled sky points (the per-split files are already sampled, so this is approximate but within the render budget). A split whose summary is missing is skipped — its rows stay reachable via global random sampling but won't appear in the sky map or class counts. This is purely client-side; the per-split files and `build_summary.py` are unchanged, so the base offsets only line up because each `summary.totalRows` equals that split's `num_examples`.
43
47
44
48
Why pre-computed: `HFDiskDataSource` builds the summary by scanning the entire dataset. Impossible for a multi-GB remote dataset, and HF's datasets-server doesn't expose per-row sky positions.
0 commit comments