mitai-jinkendo/backend/data_layer
Lars 285184ba89
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
fix: add missing statistics import and update focus_weights function
Two critical fixes for placeholder resolution:

1. Missing import in activity_metrics.py:
   - Added 'import statistics' at module level
   - Fixes calculate_monotony_score() and calculate_strain_score()
   - Error: NameError: name 'statistics' is not defined

2. Outdated focus_weights function in body_metrics.py:
   - Changed from goal_utils.get_focus_weights (uses old focus_areas table)
   - To data_layer.scores.get_user_focus_weights (uses new v2.0 system)
   - Fixes calculate_body_progress_score()
   - Error: UndefinedTable: relation "focus_areas" does not exist

These were causing many placeholders to fail silently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 20:46:21 +01:00
..
__init__.py feat: Phase 0c - migrate correlation_metrics to data_layer/correlations (11 functions) 2026-03-28 20:28:26 +01:00
activity_metrics.py fix: add missing statistics import and update focus_weights function 2026-03-28 20:46:21 +01:00
body_metrics.py fix: add missing statistics import and update focus_weights function 2026-03-28 20:46:21 +01:00
correlations.py fix: Phase 0c - update all in-function imports to use data_layer 2026-03-28 20:36:50 +01:00
health_metrics.py feat: Phase 0c - health_metrics.py module complete 2026-03-28 19:15:31 +01:00
nutrition_metrics.py feat: Phase 0c - migrate nutrition_metrics calculations to data_layer (16 functions) 2026-03-28 19:57:13 +01:00
recovery_metrics.py fix: Phase 0c - update all in-function imports to use data_layer 2026-03-28 20:36:50 +01:00
scores.py fix: Phase 0c - update all in-function imports to use data_layer 2026-03-28 20:36:50 +01:00
utils.py feat: Phase 0c - Multi-Layer Data Architecture (Proof of Concept) 2026-03-28 18:26:22 +01:00