Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ services:
condition: service_completed_successfully
networks:
- internal
- proxy
- gateway-garmin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/ready"]
interval: 30s
Expand Down Expand Up @@ -231,5 +231,6 @@ volumes:
networks:
internal:
driver: bridge
proxy:
external: true # must exist: docker network create proxy
gateway-garmin:
external: true
name: gateway-garmin
2 changes: 1 addition & 1 deletion ml-service/src/models/sleep_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _std_hours_circular(hours: list[float]) -> float:
"""
if len(hours) < 2:
return 0.0
angles = [h / 24.0 * 2 * math.pi for h in hours]
angles = [float(h) / 24.0 * 2 * math.pi for h in hours]
sin_mean = sum(math.sin(a) for a in angles) / len(angles)
cos_mean = sum(math.cos(a) for a in angles) / len(angles)
R = math.sqrt(sin_mean**2 + cos_mean**2)
Expand Down