feat(backend): introduce session controller and status models

Implement DeviceController and SessionController to bridge QML requests with backend state, supporting playback replay tracking, cluster averaging, and slot error boundaries.
This commit is contained in:
jack
2026-06-25 13:47:21 -07:00
parent 470f8acba3
commit 2cbc143c20
4 changed files with 40 additions and 30 deletions
+8 -2
View File
@@ -17,8 +17,14 @@ Returns:
x = np.array(series_a, dtype=float)
y = np.array(series_b, dtype=float)
if x.size == 0 or y.size == 0:
return {"distance": float('inf'), "index_a": [],"index_b": [], "warping_path": []}
# Filter out NaN/Inf values so dtw doesn't choke on them.
mask_x = np.isfinite(x)
mask_y = np.isfinite(y)
if not mask_x.any() or not mask_y.any():
return {"distance": float('inf'), "index_a": [], "index_b": [], "warping_path": []}
x = x[mask_x]
y = y[mask_y]
alignment = dtw(x, y, keep_internals=True)
return {