Commit ·
5877a68
1
Parent(s): 3e54b83
Replace 12-hour emoji strip with NWS KOKX radar loop
Browse filesThe hourly emoji+temperature table didn't make its source obvious and
duplicated info the chart already conveys. Swap it for an animated NWS
radar loop (station KOKX at Upton, NY — covers Long Island including
Westhampton Beach). The GIF refreshes itself in the browser, so it
stays live without any work on our side.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
app.py
CHANGED
|
@@ -22,7 +22,6 @@ from src.forecast import forecast_series
|
|
| 22 |
from src.weather_ui import (
|
| 23 |
aligned_comparison_markdown,
|
| 24 |
combined_figure,
|
| 25 |
-
emoji_strip_markdown,
|
| 26 |
hero_markdown,
|
| 27 |
)
|
| 28 |
|
|
@@ -224,14 +223,13 @@ def refresh(cycle_label: str = "Hourly", horizon_label: str = "24 h"):
|
|
| 224 |
)
|
| 225 |
else:
|
| 226 |
comparison_md = ""
|
| 227 |
-
strip = emoji_strip_markdown(nws_df_raw, DISPLAY_TZ, n=12)
|
| 228 |
scoreboard = render_scoreboard(log_conn)
|
| 229 |
|
| 230 |
# Backup forecast log to HF Dataset (non-blocking).
|
| 231 |
persist.push_db_async()
|
| 232 |
# The full archive sync + push happens in the autorefresh thread.
|
| 233 |
|
| 234 |
-
return hero, comparison_md,
|
| 235 |
|
| 236 |
|
| 237 |
# --- scoreboard ----------------------------------------------------------
|
|
@@ -329,7 +327,21 @@ with gr.Blocks(title="Toto Weather Forecast", theme=gr.themes.Soft()) as demo:
|
|
| 329 |
|
| 330 |
hero_md = gr.Markdown()
|
| 331 |
comparison_md = gr.Markdown()
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
|
| 334 |
with gr.Row():
|
| 335 |
cycle_dd = gr.Dropdown(
|
|
@@ -369,7 +381,7 @@ with gr.Blocks(title="Toto Weather Forecast", theme=gr.themes.Soft()) as demo:
|
|
| 369 |
"Full spec: [`docs/toto-inference.md`](https://huggingface.co/spaces/bitsofchris/time-series-ai-weather-forecast/blob/main/docs/toto-inference.md)."
|
| 370 |
)
|
| 371 |
|
| 372 |
-
outputs = [hero_md, comparison_md,
|
| 373 |
inputs = [cycle_dd, horizon_dd]
|
| 374 |
demo.load(refresh, inputs=inputs, outputs=outputs)
|
| 375 |
cycle_dd.change(refresh, inputs=inputs, outputs=outputs)
|
|
|
|
| 22 |
from src.weather_ui import (
|
| 23 |
aligned_comparison_markdown,
|
| 24 |
combined_figure,
|
|
|
|
| 25 |
hero_markdown,
|
| 26 |
)
|
| 27 |
|
|
|
|
| 223 |
)
|
| 224 |
else:
|
| 225 |
comparison_md = ""
|
|
|
|
| 226 |
scoreboard = render_scoreboard(log_conn)
|
| 227 |
|
| 228 |
# Backup forecast log to HF Dataset (non-blocking).
|
| 229 |
persist.push_db_async()
|
| 230 |
# The full archive sync + push happens in the autorefresh thread.
|
| 231 |
|
| 232 |
+
return hero, comparison_md, fig, scoreboard
|
| 233 |
|
| 234 |
|
| 235 |
# --- scoreboard ----------------------------------------------------------
|
|
|
|
| 327 |
|
| 328 |
hero_md = gr.Markdown()
|
| 329 |
comparison_md = gr.Markdown()
|
| 330 |
+
gr.HTML(
|
| 331 |
+
# KOKX is the NWS radar site at Upton, NY — covers Long Island incl.
|
| 332 |
+
# Westhampton Beach. The looped GIF refreshes itself on the browser
|
| 333 |
+
# so the map stays live without us doing anything.
|
| 334 |
+
'<div style="text-align:center;margin:0.5em 0;">'
|
| 335 |
+
'<a href="https://radar.weather.gov/station/kokx/standard" target="_blank" rel="noopener">'
|
| 336 |
+
'<img src="https://radar.weather.gov/ridge/standard/KOKX_loop.gif" '
|
| 337 |
+
'alt="NWS radar loop, Long Island (KOKX)" '
|
| 338 |
+
'style="max-width:560px;width:100%;border-radius:6px;border:1px solid #e0e0e0;" />'
|
| 339 |
+
'</a>'
|
| 340 |
+
'<div style="opacity:0.55;font-size:0.85em;margin-top:0.3em;">'
|
| 341 |
+
'NWS radar loop · station KOKX (Upton, NY) · refreshes ~6 min'
|
| 342 |
+
'</div>'
|
| 343 |
+
'</div>'
|
| 344 |
+
)
|
| 345 |
|
| 346 |
with gr.Row():
|
| 347 |
cycle_dd = gr.Dropdown(
|
|
|
|
| 381 |
"Full spec: [`docs/toto-inference.md`](https://huggingface.co/spaces/bitsofchris/time-series-ai-weather-forecast/blob/main/docs/toto-inference.md)."
|
| 382 |
)
|
| 383 |
|
| 384 |
+
outputs = [hero_md, comparison_md, plot, scoreboard_md]
|
| 385 |
inputs = [cycle_dd, horizon_dd]
|
| 386 |
demo.load(refresh, inputs=inputs, outputs=outputs)
|
| 387 |
cycle_dd.change(refresh, inputs=inputs, outputs=outputs)
|