From 90773a051e614a39a1e94fa33ded4345c644b4c4 Mon Sep 17 00:00:00 2001 From: Matt Greenfield Date: Sat, 18 Aug 2018 19:24:15 +0700 Subject: [PATCH] stop discarding zero stepHz values for walking models #34 --- LocoKit/Base/ActivityTypes/MutableActivityType.swift | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/LocoKit/Base/ActivityTypes/MutableActivityType.swift b/LocoKit/Base/ActivityTypes/MutableActivityType.swift index e76dee1f..e00a1d47 100644 --- a/LocoKit/Base/ActivityTypes/MutableActivityType.swift +++ b/LocoKit/Base/ActivityTypes/MutableActivityType.swift @@ -41,11 +41,8 @@ open class MutableActivityType: ActivityType { } // only accept samples that have a coordinate inside the model - guard let location = sample.location, location.coordinate.isUsable, - self.contains(coordinate: location.coordinate) else - { - continue - } + guard let location = sample.location, location.coordinate.isUsable else { continue } + guard self.contains(coordinate: location.coordinate) else { continue } totalEvents += 1 @@ -63,9 +60,7 @@ open class MutableActivityType: ActivityType { totalMoving += 1 } - // TODO: can remove second clause eventually. zero stepHz is a solved problem, there's just lots of old data - // (last time i tried removing it, the models came out yuck. so maybe it's not just old data) - if let stepHz = sample.stepHz, (self.name != .walking || stepHz > 0) { + if let stepHz = sample.stepHz { allStepHz.append(stepHz) }