From 59c5bb53c38acf65362ea1381970d97c75743900 Mon Sep 17 00:00:00 2001 From: Shing Chan Date: Tue, 5 Nov 2024 23:00:32 +0000 Subject: [PATCH] fix: fix wrong wear time calculation (missing brackets) --- src/stepcount/stepcount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stepcount/stepcount.py b/src/stepcount/stepcount.py index e511ed6..3556529 100644 --- a/src/stepcount/stepcount.py +++ b/src/stepcount/stepcount.py @@ -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 - nonwear_time) / (60 * 60 * 24) coverage = (~na).groupby(na.index.hour).mean() covers24hok = int(len(coverage) == 24 and coverage.min() >= 0.01)