Spaces:
Sleeping
Sleeping
Deploy maintained LiveHouse-TS application
Browse files- src/utils.py +6 -2
src/utils.py
CHANGED
|
@@ -1154,10 +1154,14 @@ def forecast_snapshot_status(snapshot: dict | None) -> str:
|
|
| 1154 |
"score tables alone do not contain prediction curves.")
|
| 1155 |
actuals = snapshot.get("actuals", [])
|
| 1156 |
observed = sum(value is not None for value in actuals)
|
| 1157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1158 |
return (f"**{state}** 路 Ground truth: **{observed}/{len(actuals)}** target points. "
|
| 1159 |
f"Forecast frozen: {snapshot.get('forecast_created_at', snapshot.get('issued_at', 'unknown'))} (UTC). "
|
| 1160 |
-
"
|
| 1161 |
"The latest completed forecast is kept for comparison once available.")
|
| 1162 |
|
| 1163 |
|
|
|
|
| 1154 |
"score tables alone do not contain prediction curves.")
|
| 1155 |
actuals = snapshot.get("actuals", [])
|
| 1156 |
observed = sum(value is not None for value in actuals)
|
| 1157 |
+
status = snapshot.get("status", "resolved" if observed == len(actuals) else "pending")
|
| 1158 |
+
state = {"resolved": "Completed forecast", "expired": "Expired window 路 some targets are no longer available"}.get(
|
| 1159 |
+
status, "Live forecast 路 awaiting complete ground truth")
|
| 1160 |
+
missing = ("Missing targets remain blank; this incomplete window is not scored. " if status == "expired"
|
| 1161 |
+
else "Missing targets remain blank until their periods close and observations arrive. ")
|
| 1162 |
return (f"**{state}** 路 Ground truth: **{observed}/{len(actuals)}** target points. "
|
| 1163 |
f"Forecast frozen: {snapshot.get('forecast_created_at', snapshot.get('issued_at', 'unknown'))} (UTC). "
|
| 1164 |
+
f"{missing}"
|
| 1165 |
"The latest completed forecast is kept for comparison once available.")
|
| 1166 |
|
| 1167 |
|