feat: Phase 0c - Multi-Layer Data Architecture (Proof of Concept)
- Add data_layer/ module structure with utils.py + body_metrics.py - Migrate 3 functions: weight_trend, body_composition, circumference_summary - Refactor placeholders to use data layer - Add charts router with 3 Chart.js endpoints - Tests: Syntax ✅, Confidence logic ✅ Phase 0c PoC (3 functions): Foundation for 40+ remaining functions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
255d1d61c5
commit
c79cc9eafb
6 files changed
+959
-82
No files matched your search
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
Data Layer - Pure Data Retrieval & Calculation Logic
|
||||
|
||||
This module provides structured data functions for all metrics.
|
||||
NO FORMATTING. NO STRINGS WITH UNITS. Only structured data.
|
||||
|
||||
Usage:
|
||||
from data_layer.body_metrics import get_weight_trend_data
|
||||
|
||||
data = get_weight_trend_data(profile_id="123", days=28)
|
||||
# Returns: {"slope_28d": 0.23, "confidence": "high", ...}
|
||||
|
||||
Modules:
|
||||
- body_metrics: Weight, body fat, lean mass, circumferences
|
||||
- nutrition_metrics: Calories, protein, macros, adherence
|
||||
- activity_metrics: Training volume, quality, abilities
|
||||
- recovery_metrics: Sleep, RHR, HRV, recovery score
|
||||
- health_metrics: Blood pressure, VO2Max, health stability
|
||||
- goals: Active goals, progress, projections
|
||||
- correlations: Lag-analysis, plateau detection
|
||||
- utils: Shared functions (confidence, baseline, outliers)
|
||||
|
||||
Phase 0c: Multi-Layer Architecture
|
||||
Version: 1.0
|
||||
Created: 2026-03-28
|
||||
"""
|
||||
|
||||
# Core utilities
|
||||
from .utils import *
|
||||
|
||||
# Metric modules
|
||||
from .body_metrics import *
|
||||
|
||||
# Future imports (will be added as modules are created):
|
||||
# from .nutrition_metrics import *
|
||||
# from .activity_metrics import *
|
||||
# from .recovery_metrics import *
|
||||
# from .health_metrics import *
|
||||
# from .goals import *
|
||||
# from .correlations import *
|
||||
|
||||
__all__ = [
|
||||
# Utils
|
||||
'calculate_confidence',
|
||||
'serialize_dates',
|
||||
|
||||
# Body Metrics
|
||||
'get_weight_trend_data',
|
||||
'get_body_composition_data',
|
||||
'get_circumference_summary_data',
|
||||
]
|
||||
Reference in new issue
Block a user