Skip to content

Commit

Permalink
fix: fix wrong wear time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
chanshing committed Nov 6, 2024
1 parent f8cc010 commit 25ea89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stepcount/stepcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def summarize_wear_time(
wear_start = data.first_valid_index().strftime("%Y-%m-%d %H:%M:%S")
wear_end = data.last_valid_index().strftime("%Y-%m-%d %H:%M:%S")
nonwear_time = na.sum() * dt / (60 * 60 * 24)
wear_time = (len(data) * dt - nonwear_time) / (60 * 60 * 24)
wear_time = len(data) * dt / (60 * 60 * 24) - nonwear_time
coverage = (~na).groupby(na.index.hour).mean()
covers24hok = int(len(coverage) == 24 and coverage.min() >= 0.01)

Expand Down

0 comments on commit 25ea89c

Please sign in to comment.