补齐 Autocal 实时反馈与稳定窗口复核
显示实时力值、曲线及 UV 图层,并保存人工确认窗口和零载检查基准。定向测试、真实视频预览与已录会话复核闭环验证通过。
This commit is contained in:
@@ -210,9 +210,11 @@ class MetricHistory:
|
||||
y_ranges = []
|
||||
for i in range(self.channels):
|
||||
col = values[:, i]
|
||||
ymin = float(np.nanmin(col))
|
||||
ymax = float(np.nanmax(col))
|
||||
if not np.isfinite(ymin) or not np.isfinite(ymax):
|
||||
finite = col[np.isfinite(col)]
|
||||
if finite.size:
|
||||
ymin = float(finite.min())
|
||||
ymax = float(finite.max())
|
||||
else:
|
||||
ymin, ymax = 0.0, 1.0
|
||||
y_ranges.append(self._smooth_y_range(i, ymin, ymax))
|
||||
return PlotState(
|
||||
|
||||
@@ -3,9 +3,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import numpy as np
|
||||
import warnings
|
||||
from orisys_app_shared.force.history import MetricHistory
|
||||
|
||||
|
||||
def test_unavailable_channels_keep_gaps_without_empty_slice_warnings():
|
||||
history = MetricHistory()
|
||||
history.push(1, np.nan, np.nan, np.nan)
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("error", RuntimeWarning)
|
||||
state = history.state()
|
||||
assert np.isnan(state.values).all()
|
||||
assert all(np.isfinite(bounds).all() and bounds[0] < bounds[1]
|
||||
for bounds in state.y_ranges)
|
||||
|
||||
|
||||
def _push_at_rate(hist: MetricHistory, *, fps: float, duration_sec: float, t0: float = 1000.0) -> None:
|
||||
dt = 1.0 / fps
|
||||
n = int(round(duration_sec * fps)) + 1
|
||||
|
||||
Reference in New Issue
Block a user