diff --git a/docker-compose.yml b/docker-compose.yml index 21b371c..85c5168 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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 diff --git a/ml-service/src/models/sleep_metrics.py b/ml-service/src/models/sleep_metrics.py index 3eecb35..dbffd3a 100644 --- a/ml-service/src/models/sleep_metrics.py +++ b/ml-service/src/models/sleep_metrics.py @@ -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)