feat(weather): historical anomaly callouts vs normal (#325)#561
Open
feat(weather): historical anomaly callouts vs normal (#325)#561
Conversation
…ine (#325) - Add `_enrich_with_anomaly_callout` async method that calls the existing (but previously unused) `compute_anomaly()` in a thread pool executor and stores the result in `WeatherData.anomaly_callout` - Lazily create a dedicated `OpenMeteoApiClient` for archive queries via the new `openmeteo_archive_client` property - Register the enrichment task in `_launch_enrichment_tasks()`; skipped in test mode and when no current temperature is available - Add `tests/test_weather_client_anomaly.py` covering enrichment success, None result, missing data, exception handling, and task creation logic - Update CHANGELOG with user-facing description Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compute_anomaly()function into the weather enrichment pipelineNone→ metric not shown), network failures, and test modeChanges
weather_client_base.py: newopenmeteo_archive_clientlazy property +_enrich_with_anomaly_calloutasync method + task registration in_launch_enrichment_tasks()tests/test_weather_client_anomaly.py: 11 new tests covering enrichment success/None/missing-temp/exception/task-inclusion logicCHANGELOG.md: user-facing entry under[Unreleased]Acceptance criteria
None, no metric displayed)Closes #325
🤖 Generated with Claude Code