MatthewFlamm / pynws

⛈️ A python library to asynchronously retrieve weather observation from NWS/NOAA
MIT License
33 stars 10 forks source link

Make forecast caching match observation caching #200

Closed MatthewFlamm closed 6 months ago

MatthewFlamm commented 6 months ago

~Downside of this approach is that it adds some calculations to the forecast in addition to checking for filtered forecasts. This will duplicate calculations. Future enhancement would have a separate method for filtering and additions.~

Code refactored to filter forecast for old forecasts separately from making additions.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.67%. Comparing base (f050161) to head (068585c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #200 +/- ## ========================================== + Coverage 93.40% 93.67% +0.26% ========================================== Files 9 9 Lines 622 632 +10 ========================================== + Hits 581 592 +11 + Misses 41 40 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MatthewFlamm commented 6 months ago

Not updating cache would be expected in use with retry_no_data=True. This was found in https://github.com/home-assistant/core/pull/117109

lymanepp commented 6 months ago

Looks okay to me.