@@ 269,7 269,10 @@ def analyse(track: Track, athlete_data: Mapping[str, float], raw: bool = False):
dist_deltas = np.diff(dist[:, 1])
speed = dist_deltas / time_deltas
moving_seconds = np.dot(np.greater(speed, MOVING_THRESHOLD), time_deltas)
- assert moving_seconds <= elapsed_seconds
+
+ # In general moving time has to be less than or equal to elapsed time, but
+ # allow for 1% rounding error.
+ assert moving_seconds <= (elapsed_seconds * 1.01)
hr = np.zeros((raw_hr.shape[0], 2))
if raw_hr.shape[0] > 0: