v1.5.0 Phase 4: precipitation nowcast (#88) #115
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!115
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/v1.5.0-phase4-radar-viz"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A short-range point precipitation nowcast per location using RainViewer's
nowcastframes.services/nowcast.py:precip_nowcast(lat, lon)fetchesweather-maps.json, samples the location's tile pixel (zoom 8, ~0.5 km/px) across the latestpastframe ("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 forradar_cache_minutes.GET /api/locations/{id}/nowcast(auth + visibility) →{enabled:false}when off,{available:false}on failure, else the dict.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. (
respxfor HTTP mocking is already inrequirements-test.txt.)Closes #88
🤖 Generated with Claude Code
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>