Datasets:
Download validate.py from ScreeperC/CounterPoint-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/datasets/ScreeperC/CounterPoint-dataset/resolve/main/validate.py
- Command line
-
hf download hf://datasets/ScreeperC/CounterPoint-dataset/validate.py
-
curl -L -o validate.py https://huggingface.co/datasets/ScreeperC/CounterPoint-dataset/resolve/main/validate.py
1.37 kB
| """Check payload inventory, referenced media, and trial identity alignment.""" | |
| import json | |
| from pathlib import Path | |
| import pyarrow.parquet as pq | |
| root = Path(__file__).resolve().parent | |
| entries = [json.loads(line) for line in (root / "manifest.jsonl").read_text().splitlines()] | |
| for entry in entries: | |
| path = root / entry["path"] | |
| assert path.is_file(), f"Missing file: {path}" | |
| assert path.stat().st_size == entry["bytes"], f"Size mismatch: {path}" | |
| media = pq.read_table(root / "cluster/media.parquet").to_pylist() | |
| trials = pq.read_table(root / "cluster/trials.parquet").to_pylist() | |
| assert len(media) == len(trials) == 18880 | |
| assert len({r["trial_id"] for r in media}) == len(media) | |
| assert {(r["trial_id"], r["stem"]) for r in media} == { | |
| (r["trial_id"], r["stem"]) for r in trials | |
| } | |
| for row in media: | |
| for key in ("path_video",): | |
| assert (root / "cluster" / row[key]).is_file(), (row["trial_id"], key) | |
| for excluded in ("cluster/audio", "cluster/haptic", "cluster/image", "havdb/datah5", "havdb/img"): | |
| assert not (root / excluded).exists(), f"Upstream payload should be excluded: {excluded}" | |
| meta = json.loads((root / "havdb/cache/meta.json").read_text()) | |
| assert all(len(meta[key]) == 500 for key in ("user", "texture", "trial", "length")) | |
| print(f"Validated {len(entries)} payload files, 18,880 Cluster trials, 500 HAVdb feature entries.") | |