v1.5.0 Phase 4: precipitation nowcast (#88) #115

Merged
claude-bot merged 1 commit from feat/v1.5.0-phase4-radar-viz into main 2026-07-19 16:07:43 +00:00
Contributor

A short-range point precipitation nowcast per location using RainViewer's nowcast frames.

  • services/nowcast.py: precip_nowcast(lat, lon) fetches weather-maps.json, samples the location's tile pixel (zoom 8, ~0.5 km/px) across the latest past frame ("now") + up to 7 future frames, and derives {now, starts_in_min, ends_in_min, summary}. One reused httpx client, ≤8 tiles, PIL alpha-threshold precip detection. Fully fail-soft (any error → None, never raises). Cached in-memory per rounded coord for radar_cache_minutes.
  • GET /api/locations/{id}/nowcast (auth + visibility) → {enabled:false} when off, {available:false} on failure, else the dict.
  • Dashboard: a lazy per-card fetch() fills a "💧 rain starting in ~X min" line after render; hidden on error/disabled/unavailable — never blocks page load.
  • PRECIP_NOWCAST_ENABLED (default true).

Documented caveats: RainViewer is a global mosaic (not the authoritative NWS NEXRAD the dashboard radar uses), single-pixel sampling is coarse, horizon is short (~30 min) — a heads-up, not a forecast; NWS alerts remain the source of truth.

Testing (dev server)

ruff clean; 16 nowcast tests; bulk suite 739 passed. (respx for HTTP mocking is already in requirements-test.txt.)

Closes #88

🤖 Generated with Claude Code

A short-range point precipitation nowcast per location using RainViewer's `nowcast` frames. - `services/nowcast.py`: `precip_nowcast(lat, lon)` fetches `weather-maps.json`, samples the location's tile pixel (zoom 8, ~0.5 km/px) across the latest `past` frame ("now") + up to 7 future frames, and derives `{now, starts_in_min, ends_in_min, summary}`. One reused httpx client, ≤8 tiles, PIL alpha-threshold precip detection. **Fully fail-soft** (any error → None, never raises). Cached in-memory per rounded coord for `radar_cache_minutes`. - `GET /api/locations/{id}/nowcast` (auth + visibility) → `{enabled:false}` when off, `{available:false}` on failure, else the dict. - Dashboard: a lazy per-card `fetch()` fills a "💧 rain starting in ~X min" line **after** render; hidden on error/disabled/unavailable — never blocks page load. - `PRECIP_NOWCAST_ENABLED` (default true). **Documented caveats**: RainViewer is a global mosaic (not the authoritative NWS NEXRAD the dashboard radar uses), single-pixel sampling is coarse, horizon is short (~30 min) — a heads-up, not a forecast; NWS alerts remain the source of truth. ## Testing (dev server) ruff clean; 16 nowcast tests; bulk suite **739 passed**. (`respx` for HTTP mocking is already in `requirements-test.txt`.) Closes #88 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add precipitation nowcast ("rain starting in ~X min") (#88)
All checks were successful
CI / test (pull_request) Successful in 4m23s
91a4ddcf8c
A short-range point nowcast per location using RainViewer's future frames.

- app/services/nowcast.py: precip_nowcast(lat, lon) fetches RainViewer
  weather-maps.json, samples the location's tile pixel (zoom 8, ~0.5 km/px)
  across the latest past frame ("now") + up to 7 nowcast frames, and derives
  {now, starts_in_min, ends_in_min, summary}. Reuses one httpx client, caps at
  <=8 tiles, PIL alpha-threshold precip detection. Fully fail-soft (any error ->
  None, never raises). Cached in-memory per rounded coord for radar_cache_minutes.
- GET /api/locations/{id}/nowcast (auth + visibility); returns {enabled:false}
  when off, {available:false} on failure, else the dict.
- Dashboard: a lazy per-card fetch fills a "💧 rain starting in ~X min" line
  after render; hidden on error/disabled/unavailable — never blocks page load.
- PRECIP_NOWCAST_ENABLED (default true).

Caveats documented: RainViewer is a global mosaic (not the authoritative NWS
NEXRAD the dashboard radar uses), single-pixel sampling is coarse, and the
horizon is short (~30 min) — it's a heads-up, not a forecast; NWS alerts remain
the source of truth.

Full suite green on the dev server: 739 passed.

Closes #88

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claude-bot deleted branch feat/v1.5.0-phase4-radar-viz 2026-07-19 16:07:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot!115
No description provided.