Skip to content

feat(weather): add rule-based weather impact summaries#562

Open
Orinks wants to merge 1 commit intodevfrom
feat/weather-impact-summaries-324
Open

feat(weather): add rule-based weather impact summaries#562
Orinks wants to merge 1 commit intodevfrom
feat/weather-impact-summaries-324

Conversation

@Orinks
Copy link
Copy Markdown
Owner

@Orinks Orinks commented Mar 31, 2026

Summary

  • Adds src/accessiweather/impact_summary.py with three transparent, rule-based impact scorers: Outdoor (comfort/activity), Driving (visibility/ice/wind/precip), and Allergy (pollen/AQI/wind dispersion)
  • Integrates impact metrics into CurrentConditionsPresentation as Impact: Outdoor, Impact: Driving, and Impact: Allergy metrics (included in screen-reader fallback text)
  • Attaches impact_summary field to both CurrentConditionsPresentation and ForecastPresentation for downstream consumers
  • 128 new unit tests covering all rule thresholds, boundary conditions, and integration with the presentation layer

Rule sets (fully documented in module docstring)

Area Key rules
Outdoor 11 temperature comfort bands via feels-like; UV ≥8 / ≥6 modifiers; active-precipitation keyword detection
Driving Visibility < 0.25/1/3 mi tiers; ice > snow > thunder > rain priority; near-freezing (25–36°F) + moisture → black-ice; wind ≥45/30/20 mph tiers
Allergy Pollen category bands (None→Extreme); allergen callout; wind ≥15 mph + moderate+ pollen → dispersion note; AQ unhealthy/sensitive modifiers

Acceptance criteria

  • Impact summary appears in current conditions view (as metrics + fallback text)
  • Impact summary available on forecast presentation (first period)
  • Rule set documented in module docstring and fully unit-tested (128 tests)
  • No additional API dependencies
  • Screen-reader fallback text includes all Impact metrics
  • All 3 214 existing tests still pass

Closes #324

Adds a new `impact_summary` module with transparent, unit-tested rule sets
for three lifestyle contexts:

- Outdoor: comfort band from feels-like temperature, UV protection notes,
  active precipitation warnings
- Driving: visibility thresholds, precipitation-type hazards (ice > snow >
  thunder > rain), near-freezing black-ice risk, wind severity
- Allergy: pollen category/index bands with allergen callout, wind dispersion
  note, air quality modifier

Impact summaries appear as "Impact: Outdoor / Driving / Allergy" metrics in
the current conditions presentation and are included in screen-reader fallback
text. The forecast presentation also receives an impact summary derived from
the first forecast period.

No new API dependencies required. All rules are fully documented and covered
by 128 dedicated unit tests.

Closes #324

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant