refactor: Phase 2 — slim weather_client_base.py (remove delegation stub batch 2)#456
Merged
refactor: Phase 2 — slim weather_client_base.py (remove delegation stub batch 2)#456
Conversation
…herClient Deleted 11 never-called delegation stubs from WeatherClient: - 7 _parse_nws_* / _parse_openmeteo_* stubs (delegated to nws_client/openmeteo_client) - 4 _compute_*_trend / _trend_descriptor / _period_for_hours_ahead stubs (delegated to trends) All were dead code — grep confirms zero callers anywhere in src/ or tests/. Saves ~43 lines (1303 → 1260). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced 7 self._enrich_with_* / self._populate_environmental_metrics / self._apply_trend_insights stub calls with direct enrichment.* and trends.* calls in _launch_enrichment_tasks and _await_enrichments, then deleted the now-redundant stub method definitions. The NWS/OpenMeteo fetch stubs (_get_nws_*, _get_openmeteo_*) are intentionally preserved as mock seam points used by _methods_overridden and test AsyncMocks. Saves ~36 lines (1260 → 1224). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rage gate Add two tests to exercise the `if self.data_source == "auto":` branch in `WeatherClient._launch_enrichment_tasks` (lines 912-924), which were the uncovered lines identified by diff-cover on refactor/monolith-phase2. 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
Continues the Phase 1 monolith refactor by removing the next batch of delegation stubs from
weather_client_base.py.Task 1 — Dead-code parse + trend stubs deleted (11 stubs, −43 lines)
Seven
_parse_nws_*/_parse_openmeteo_*stubs and four trend stubs (_compute_temperature_trend,_compute_pressure_trend,_trend_descriptor,_period_for_hours_ahead) had zero callers anywhere in the codebase. Pure noise — deleted.Task 2 — Enrichment + trend stubs inlined (7 stubs, −36 lines)
Replaced
self._enrich_with_*/self._populate_environmental_metrics/self._apply_trend_insightscalls in_launch_enrichment_tasksand_await_enrichmentswith directenrichment.*/trends.*calls, then deleted the now-redundant stub definitions.Not touched — intentional mock seam points preserved
_get_nws_*and_get_openmeteo_*fetch stubs are kept. They serve as override points detected by_methods_overridden()and are mocked directly intest_nws_afd_notification.py,test_split_notification_timers.py, andtest_coverage_gaps.py.Test plan
python3 -m pytest --tb=short -q— 2649 passed, 4 skipped, same 7 pre-existing VC integration failures (require live API keys)ruff check src/accessiweather/weather_client_base.py— no errors🤖 Generated with Claude Code