Skip to content

Commit

Permalink
stop discarding zero stepHz values for walking models #34
Browse files Browse the repository at this point in the history
  • Loading branch information
sobri909 committed Aug 18, 2018
1 parent 69f2106 commit 90773a0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions LocoKit/Base/ActivityTypes/MutableActivityType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
}

Expand Down

0 comments on commit 90773a0

Please sign in to comment.