- body_metrics.py: K1-K5 calculations (weight trend, FM/LBM, circumferences, recomposition, body score) - nutrition_metrics.py: E1-E5 calculations (energy balance, protein adequacy, macro consistency, nutrition score) - activity_metrics.py: A1-A8 calculations (training volume, intensity, quality, ability balance, load monitoring) - recovery_metrics.py: Improved Recovery Score v2 (HRV, RHR, sleep, regularity, load balance) - correlation_metrics.py: C1-C7 calculations (lagged correlations, plateau detection, driver panel) - scores.py: Meta-scores with Dynamic Focus Areas v2.0 integration All calculations include: - Data quality assessment - Confidence levels - Dynamic weighting by user's focus area priorities - Support for custom goals via goal_utils integration Next: Placeholder integration in placeholder_resolver.py
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
"""
|
|
Calculation Engine for Phase 0b - Goal-Aware Placeholders
|
|
|
|
This package contains all metric calculation functions for:
|
|
- Body metrics (K1-K5 from visualization concept)
|
|
- Nutrition metrics (E1-E5)
|
|
- Activity metrics (A1-A8)
|
|
- Recovery metrics (S1)
|
|
- Correlations (C1-C7)
|
|
- Scores (Goal Progress Score with Dynamic Focus Areas)
|
|
|
|
All calculations are designed to work with Dynamic Focus Areas v2.0.
|
|
"""
|
|
|
|
from .body_metrics import *
|
|
from .nutrition_metrics import *
|
|
from .activity_metrics import *
|
|
from .recovery_metrics import *
|
|
from .correlation_metrics import *
|
|
from .scores import *
|
|
|
|
__all__ = [
|
|
# Body
|
|
'calculate_weight_7d_median',
|
|
'calculate_weight_28d_slope',
|
|
'calculate_fm_28d_change',
|
|
'calculate_lbm_28d_change',
|
|
'calculate_body_progress_score',
|
|
|
|
# Nutrition
|
|
'calculate_energy_balance_7d',
|
|
'calculate_protein_g_per_kg',
|
|
'calculate_nutrition_score',
|
|
|
|
# Activity
|
|
'calculate_training_minutes_week',
|
|
'calculate_activity_score',
|
|
|
|
# Recovery
|
|
'calculate_recovery_score_v2',
|
|
|
|
# Correlations
|
|
'calculate_lag_correlation',
|
|
|
|
# Meta Scores
|
|
'calculate_goal_progress_score',
|
|
'calculate_data_quality_score',
|
|
]
|