added stool tracking + toothbrushing tracking

This commit is contained in:
Joren de Graaf
2026-10-02 11:32:59 +02:00
parent d1fbb52937
commit 943dc2280f
16 changed files with 641 additions and 87 deletions
+7 -4
View File
@@ -16,10 +16,13 @@ class CheckInStreaks:
def is_low_pain(check_in, threshold=LOW_PAIN_STREAK_THRESHOLD):
return (
check_in.neck_pain_severity <= threshold
and check_in.headache_severity <= threshold
)
"""A confirmed low-pain day needs both scores in every time period."""
for period, _, _ in check_in.PERIODS:
neck = getattr(check_in, f"{period}_neck_pain_severity")
headache = getattr(check_in, f"{period}_headache_severity")
if neck is None or headache is None or neck > threshold or headache > threshold:
return False
return True
def calculate_check_in_streaks(check_ins, as_of_date, threshold=LOW_PAIN_STREAK_THRESHOLD):