feat: support reverse geocoding for coordinates - #29
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #29 +/- ##
==========================================
+ Coverage 99.47% 99.49% +0.01%
==========================================
Files 39 39
Lines 5334 5506 +172
Branches 309 319 +10
==========================================
+ Hits 5306 5478 +172
Misses 17 17
Partials 11 11 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Pull request overview
This PR updates the location configuration contract to allow a watched location to be specified by name, coordinates, or both, and adds reverse geocoding (Nominatim /reverse) to resolve coordinate-only entries into a canonical display name plus administrative metadata. It fits into the existing geocoding/resolution pipeline by extending the provider boundary and enhancing the cache-backed resolver to support a coordinate-only path.
Changes:
- Make
LocationSpec.nameoptional and update configuration validation to accept eithernameor a complete(latitude, longitude)pair. - Add a reverse-geocoding provider boundary and implement reverse geocoding in
NominatimGeocodingProvider, wired intoCachedLocationResolverand the CLI. - Add focused tests and update docs/README to reflect the new configuration and resolution behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| weather_briefing/models.py | Makes LocationSpec.name optional to support coordinate-only entries. |
| weather_briefing/geocoding.py | Adds reverse geocoding support, integrates it into the cached resolver, and tightens name-handling via helper. |
| weather_briefing/config.py | Updates location-file parsing/validation to allow name-only, coords-only, or both. |
| weather_briefing/cli.py | Wires Nominatim reverse geocoding into the runtime resolver configuration. |
| tests/test_geocoding.py | Adds reverse-geocoding and coordinate-only resolver/cache tests. |
| tests/test_config.py | Updates config tests for the new location contract and validation errors. |
| README.md | Updates user-facing configuration and geocoding behavior documentation. |
| docs/requirements.md | Updates requirements to specify the revised location contract and reverse-geocoding behavior. |
| docs/design.md | Updates design notes to reflect forward vs reverse resolution paths and caching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b81b68 to
688d0fb
Compare
688d0fb to
3ae1f8a
Compare
Summary
Allow a watched location to be configured with either a complete name or a complete coordinate pair while keeping
idrequired.This is intentionally separate from #28: that PR improves notification relevance using the currently required user-provided name; this PR changes the location configuration contract and adds reverse geocoding for coordinate-only entries.
Configuration contract
idremains required; its existing validation and error semantics are unchanged.name, bothlatitudeandlongitude, or all three./reverse, then cache the canonical display name, country code, and administrative area.Changes
Privacy review
Committed examples and tests use public sample coordinates and place names only. No private location file, runtime cache, feed URL, credentials, recipient identifiers, or state is included.
Dependency note
The branch is rebased on the merge of #28. Its notification-relevance and source-attribution behavior is preserved; this PR changes only the location configuration and resolution contract.
Validation
mise exec -- uv run --with pytest --with pytest-cov -- pytest --cov --cov-branch --cov-report=xml— 438 passedprek run— all checks passed