Spaces:
Sleeping
Sleeping
Dan Vancea commited on
Commit ·
632daa5
1
Parent(s): 30771f0
Update predict_from_supabase.py
Browse files- predict_from_supabase.py +2 -2
predict_from_supabase.py
CHANGED
|
@@ -5,7 +5,7 @@ Supabase and return the PPO-recommended replacement schedule.
|
|
| 5 |
|
| 6 |
import os
|
| 7 |
import numpy as np
|
| 8 |
-
from datetime import datetime
|
| 9 |
from supabase import create_client
|
| 10 |
from stable_baselines3 import PPO
|
| 11 |
from model import DegradationModel
|
|
@@ -64,7 +64,7 @@ def _fetch_health(printer_id: str, t: datetime) -> np.ndarray:
|
|
| 64 |
if not printer:
|
| 65 |
raise ValueError(f"Printer {printer_id} not found")
|
| 66 |
|
| 67 |
-
last_repair = datetime.fromisoformat(printer["last_repair"])
|
| 68 |
time_step_id = int((t - last_repair).total_seconds() // 3600)
|
| 69 |
|
| 70 |
row = (
|
|
|
|
| 5 |
|
| 6 |
import os
|
| 7 |
import numpy as np
|
| 8 |
+
from datetime import datetime, timezone
|
| 9 |
from supabase import create_client
|
| 10 |
from stable_baselines3 import PPO
|
| 11 |
from model import DegradationModel
|
|
|
|
| 64 |
if not printer:
|
| 65 |
raise ValueError(f"Printer {printer_id} not found")
|
| 66 |
|
| 67 |
+
last_repair = datetime.fromisoformat(printer["last_repair"]).replace(tzinfo=timezone.utc)
|
| 68 |
time_step_id = int((t - last_repair).total_seconds() // 3600)
|
| 69 |
|
| 70 |
row = (
|