Source-based layout: recorder exports land in source/recorder/; ETL reads own source/
Browse files- source/recorder/{builds,events,frames}.jsonl + sensors.csv (from sls-export,
which now targets this repo directly — recorder repo's data/exports retired)
- scripts/_lib.py + ticks ETL re-pointed to source/{recorder,telemetry,
position_hf} with zero-padded parquet names; frames buffer still read from
the recorder repo for builds not yet zip-delivered
- *.jsonl added to LFS tracking (frames.jsonl is ~1 GB)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4zfbNDFb7rd8ovKrUSys2
- .gitattributes +1 -0
- scripts/_lib.py +13 -9
- scripts/ticks/01_extract.py +6 -5
- source/recorder/builds.jsonl +3 -0
- source/recorder/events.jsonl +3 -0
- source/recorder/frames.jsonl +3 -0
- source/recorder/sensors.csv +66 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
scripts/_lib.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
"""Shared paths and helpers for the extract scripts.
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
files; every extract script reads from `EXPORTS_DIR` and writes to `DATA_DIR`.
|
| 6 |
"""
|
| 7 |
import json
|
| 8 |
from pathlib import Path
|
|
@@ -10,13 +9,18 @@ from pathlib import Path
|
|
| 10 |
ROOT = Path(__file__).parent.parent
|
| 11 |
DATA_DIR = ROOT / "data"
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
#
|
| 15 |
-
# `
|
| 16 |
-
#
|
| 17 |
-
#
|
|
|
|
| 18 |
AGENTIC_ROOT = ROOT.parent.parent
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
def iter_jsonl(path: Path):
|
|
|
|
| 1 |
"""Shared paths and helpers for the extract scripts.
|
| 2 |
|
| 3 |
+
Raw data lives in this dataset's own source/ tree (source-based layout,
|
| 4 |
+
2026-07-16); extract scripts read source/ and write to data/.
|
|
|
|
| 5 |
"""
|
| 6 |
import json
|
| 7 |
from pathlib import Path
|
|
|
|
| 9 |
ROOT = Path(__file__).parent.parent
|
| 10 |
DATA_DIR = ROOT / "data"
|
| 11 |
|
| 12 |
+
# Since 2026-07-16 this dataset is source-based: raw inputs live in OUR OWN
|
| 13 |
+
# source/ tree (written by the recorder repo's `sls-export` /
|
| 14 |
+
# `sls-deliver-frames`). data/exports in the recorder repo is retired.
|
| 15 |
+
# AGENTIC_ROOT still points at the containing recorder repo (submodule,
|
| 16 |
+
# two climbs) — used only for the transient frame buffer of builds not yet
|
| 17 |
+
# delivered into source/frames/ zips.
|
| 18 |
AGENTIC_ROOT = ROOT.parent.parent
|
| 19 |
+
SOURCE_DIR = ROOT / "source"
|
| 20 |
+
EXPORTS_DIR = SOURCE_DIR / "recorder" # builds/events/frames jsonl + sensors.csv
|
| 21 |
+
TELEMETRY_DIR = SOURCE_DIR / "telemetry" # {NNN}.parquet raw ticks
|
| 22 |
+
POSITION_DIR = SOURCE_DIR / "position_hf" # {NNN}.parquet
|
| 23 |
+
FRAMES_BUFFER = AGENTIC_ROOT / "data" / "frames" # pre-delivery loose frames
|
| 24 |
|
| 25 |
|
| 26 |
def iter_jsonl(path: Path):
|
scripts/ticks/01_extract.py
CHANGED
|
@@ -34,7 +34,8 @@ import pyarrow as pa
|
|
| 34 |
import pyarrow.parquet as pq
|
| 35 |
|
| 36 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 37 |
-
from _lib import EXPORTS_DIR, DATA_DIR,
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
OUTPUT_DIR = DATA_DIR / "ticks"
|
|
@@ -45,7 +46,7 @@ FRAME_KINDS = ("chamber", "galvo", "thermal")
|
|
| 45 |
# Attached like a frame (nearest-before-tick), embedded as a numeric struct.
|
| 46 |
BEDMATRIX_KIND = "bedmatrix"
|
| 47 |
# frame_* path strings are relative to this directory in the upstream recorder repo.
|
| 48 |
-
FRAMES_DIR =
|
| 49 |
# HF Image feature wire format. Both fields nullable; the struct itself is null when no frame.
|
| 50 |
IMAGE_STRUCT_TYPE = pa.struct([
|
| 51 |
pa.field("bytes", pa.binary()),
|
|
@@ -132,7 +133,7 @@ def attach_bedmatrix(wide: pl.DataFrame, frames: pl.DataFrame) -> pl.DataFrame:
|
|
| 132 |
def attach_position_hf(wide: pl.DataFrame, build_id: int) -> pl.DataFrame:
|
| 133 |
"""Append a `position_hf_burst` column: list of structs of position_hf events
|
| 134 |
in (tick_ts - WINDOW, tick_ts]. Empty list when no events in window or no parquet."""
|
| 135 |
-
pos_path =
|
| 136 |
burst_dtype = pl.List(
|
| 137 |
pl.Struct({
|
| 138 |
"ts_offset_ms": pl.Float64,
|
|
@@ -274,7 +275,7 @@ def _embed_chunk(chunk: pa.Table, output_schema: pa.Schema) -> pa.Table:
|
|
| 274 |
|
| 275 |
def process_build(build_id: int, builds_index: dict[int, dict],
|
| 276 |
profile_name_lookup: dict[int, str]) -> Path | None:
|
| 277 |
-
tel_path =
|
| 278 |
if not tel_path.exists():
|
| 279 |
return None
|
| 280 |
|
|
@@ -315,7 +316,7 @@ def main():
|
|
| 315 |
profile_name_lookup = load_build_to_profile_name()
|
| 316 |
|
| 317 |
args = [int(a) for a in sys.argv[1:]]
|
| 318 |
-
targets = args or sorted(int(p.stem) for p in
|
| 319 |
|
| 320 |
for bid in targets:
|
| 321 |
if bid not in builds_index:
|
|
|
|
| 34 |
import pyarrow.parquet as pq
|
| 35 |
|
| 36 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 37 |
+
from _lib import (EXPORTS_DIR, DATA_DIR, TELEMETRY_DIR, POSITION_DIR,
|
| 38 |
+
FRAMES_BUFFER, iter_jsonl, load_build_to_profile_name)
|
| 39 |
|
| 40 |
|
| 41 |
OUTPUT_DIR = DATA_DIR / "ticks"
|
|
|
|
| 46 |
# Attached like a frame (nearest-before-tick), embedded as a numeric struct.
|
| 47 |
BEDMATRIX_KIND = "bedmatrix"
|
| 48 |
# frame_* path strings are relative to this directory in the upstream recorder repo.
|
| 49 |
+
FRAMES_DIR = FRAMES_BUFFER # loose frames for builds not yet zip-delivered
|
| 50 |
# HF Image feature wire format. Both fields nullable; the struct itself is null when no frame.
|
| 51 |
IMAGE_STRUCT_TYPE = pa.struct([
|
| 52 |
pa.field("bytes", pa.binary()),
|
|
|
|
| 133 |
def attach_position_hf(wide: pl.DataFrame, build_id: int) -> pl.DataFrame:
|
| 134 |
"""Append a `position_hf_burst` column: list of structs of position_hf events
|
| 135 |
in (tick_ts - WINDOW, tick_ts]. Empty list when no events in window or no parquet."""
|
| 136 |
+
pos_path = POSITION_DIR / f"{build_id:03d}.parquet"
|
| 137 |
burst_dtype = pl.List(
|
| 138 |
pl.Struct({
|
| 139 |
"ts_offset_ms": pl.Float64,
|
|
|
|
| 275 |
|
| 276 |
def process_build(build_id: int, builds_index: dict[int, dict],
|
| 277 |
profile_name_lookup: dict[int, str]) -> Path | None:
|
| 278 |
+
tel_path = TELEMETRY_DIR / f"{build_id:03d}.parquet"
|
| 279 |
if not tel_path.exists():
|
| 280 |
return None
|
| 281 |
|
|
|
|
| 316 |
profile_name_lookup = load_build_to_profile_name()
|
| 317 |
|
| 318 |
args = [int(a) for a in sys.argv[1:]]
|
| 319 |
+
targets = args or sorted(int(p.stem) for p in TELEMETRY_DIR.glob("*.parquet"))
|
| 320 |
|
| 321 |
for bid in targets:
|
| 322 |
if bid not in builds_index:
|
source/recorder/builds.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:283d76ebba5e8aab39ea6da842ac920249c736a1e11c81ab80f69b3677e91957
|
| 3 |
+
size 55749
|
source/recorder/events.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7633630f362b9b2ac860253c5d6d24deb64197df7b5c3e8def4c47fa0d85d6be
|
| 3 |
+
size 162521
|
source/recorder/frames.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49d0fc2fcf5dc9d140c4370425a3e1ada698d2c86a1c3c56685a8ac62d5e1184
|
| 3 |
+
size 1084990403
|
source/recorder/sensors.csv
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
sensor_id,kind,unit,description
|
| 2 |
+
buzzer,power,,
|
| 3 |
+
fanGalvo,power,,
|
| 4 |
+
io-en,power,,
|
| 5 |
+
laser,power,,
|
| 6 |
+
laserSafety,power,,
|
| 7 |
+
lights,lights.count,,
|
| 8 |
+
lights,lights.enabled,,
|
| 9 |
+
positions,position.r,,
|
| 10 |
+
positions,position.x,,
|
| 11 |
+
positions,position.y,,
|
| 12 |
+
positions,position.z1,,
|
| 13 |
+
positions,position.z2,,
|
| 14 |
+
powderBed,temp.average,,
|
| 15 |
+
powderBed,temp.current,,
|
| 16 |
+
powderBed,temp.target,,
|
| 17 |
+
powderChamber1,temp.average,,
|
| 18 |
+
powderChamber1,temp.current,,
|
| 19 |
+
powderChamber1,temp.target,,
|
| 20 |
+
powderChamber2,temp.average,,
|
| 21 |
+
powderChamber2,temp.current,,
|
| 22 |
+
powderChamber2,temp.target,,
|
| 23 |
+
powderChamber3,temp.average,,
|
| 24 |
+
powderChamber3,temp.current,,
|
| 25 |
+
powderChamber3,temp.target,,
|
| 26 |
+
powderChamber4,temp.average,,
|
| 27 |
+
powderChamber4,temp.current,,
|
| 28 |
+
powderChamber4,temp.target,,
|
| 29 |
+
powerman,power.current,,
|
| 30 |
+
powerman,power.max,,
|
| 31 |
+
powerman,power.required,,
|
| 32 |
+
printBed,temp.average,,
|
| 33 |
+
printBed,temp.current,,
|
| 34 |
+
printBed,temp.target,,
|
| 35 |
+
printChamber1,temp.average,,
|
| 36 |
+
printChamber1,temp.current,,
|
| 37 |
+
printChamber1,temp.target,,
|
| 38 |
+
printChamber2,temp.average,,
|
| 39 |
+
printChamber2,temp.current,,
|
| 40 |
+
printChamber2,temp.target,,
|
| 41 |
+
printChamber3,temp.average,,
|
| 42 |
+
printChamber3,temp.current,,
|
| 43 |
+
printChamber3,temp.target,,
|
| 44 |
+
printChamber4,temp.average,,
|
| 45 |
+
printChamber4,temp.current,,
|
| 46 |
+
printChamber4,temp.target,,
|
| 47 |
+
quadrant1,temp.average,,
|
| 48 |
+
quadrant1,temp.current,,
|
| 49 |
+
quadrant2,temp.average,,
|
| 50 |
+
quadrant2,temp.current,,
|
| 51 |
+
quadrant3,temp.average,,
|
| 52 |
+
quadrant3,temp.current,,
|
| 53 |
+
quadrant4,temp.average,,
|
| 54 |
+
quadrant4,temp.current,,
|
| 55 |
+
surface,temp.average,,
|
| 56 |
+
surface,temp.current,,
|
| 57 |
+
surfaceAvg,temp.average,,
|
| 58 |
+
surfaceAvg,temp.current,,
|
| 59 |
+
surfaceMax,temp.average,,
|
| 60 |
+
surfaceMax,temp.current,,
|
| 61 |
+
surfaceMin,temp.average,,
|
| 62 |
+
surfaceMin,temp.current,,
|
| 63 |
+
testTemp1,temp.average,,
|
| 64 |
+
testTemp1,temp.current,,
|
| 65 |
+
wd-en,power,,
|
| 66 |
+
wd-in,power,,
|