Goals -System refactored - Platzhaltersystem enhanced (als draft) #53

Merged
Lars merged 86 commits from develop into main 2026-03-31 11:46:48 +02:00
Showing only changes of commit c21a624a50 - Show all commits

View File

@ -688,7 +688,7 @@ def get_protein_adequacy_chart(
confidence = calculate_confidence(len(rows), days, "general") confidence = calculate_confidence(len(rows), days, "general")
# Count days in target # Count days in target
days_in_target = sum(1 for v in values if target_low <= v <= target_high) days_in_target = sum(1 for v in daily_values if target_low <= v <= target_high)
return { return {
"chart_type": "line", "chart_type": "line",
@ -702,7 +702,7 @@ def get_protein_adequacy_chart(
"target_low": round(target_low, 1), "target_low": round(target_low, 1),
"target_high": round(target_high, 1), "target_high": round(target_high, 1),
"days_in_target": days_in_target, "days_in_target": days_in_target,
"target_compliance_pct": round(days_in_target / len(values) * 100, 1) if values else 0, "target_compliance_pct": round(days_in_target / len(daily_values) * 100, 1) if daily_values else 0,
"first_date": rows[0]['date'], "first_date": rows[0]['date'],
"last_date": rows[-1]['date'] "last_date": rows[-1]['date']
}) })