Spaces:
Paused
Paused
File size: 399 Bytes
5e0b58b | 1 2 3 4 5 6 7 8 9 10 11 | """Temporal helpers for signal windows."""
def window_duration_ms(tick_from: int, tick_to: int, *, dt_ms: float) -> float:
"""Return inclusive observation-window duration in milliseconds."""
if dt_ms <= 0.0:
raise ValueError("dt_ms must be positive")
if tick_to < tick_from:
raise ValueError("tick_to must be >= tick_from")
return (tick_to - tick_from + 1) * dt_ms
|