From 2d4e1b7d0468b8595e4cc8e935c0214af7f6588b Mon Sep 17 00:00:00 2001 From: Matt Greenfield Date: Wed, 22 Aug 2018 18:11:57 +0700 Subject: [PATCH] go back to discarding zero stepHz values for walking models #34 --- LocoKit/Base/ActivityTypes/MutableActivityType.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LocoKit/Base/ActivityTypes/MutableActivityType.swift b/LocoKit/Base/ActivityTypes/MutableActivityType.swift index f8656291..d2d02a61 100644 --- a/LocoKit/Base/ActivityTypes/MutableActivityType.swift +++ b/LocoKit/Base/ActivityTypes/MutableActivityType.swift @@ -59,8 +59,9 @@ open class MutableActivityType: ActivityType { if sample.movingState == .moving { totalMoving += 1 } - - if let stepHz = sample.stepHz { + + // ignore zero stepHz for walking, because it's a far too common gap in the raw data + if let stepHz = sample.stepHz, (self.name != .walking || stepHz > 0) { allStepHz.append(stepHz) }