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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user