MatthewFlamm / pynws

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

Add metadata to SimpleNWS #214

Closed kamiyo closed 2 months ago

kamiyo commented 2 months ago

Added code to populate metadata in update_forecast() and update_forecast_hourly(), and added properties to get the metadata. The metadata is only populated if response is not empty, in case the API returns metadata with empty periods.

Added tests for the metadata.

Metadata keys are stored in a list, and populated by iterating through the keys; I felt this was the easiest and lowest code way to do it.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 93.79%. Comparing base (5494e54) to head (89503a7).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #214 +/- ## ========================================== + Coverage 93.67% 93.79% +0.12% ========================================== Files 9 9 Lines 632 645 +13 ========================================== + Hits 592 605 +13 Misses 40 40 ```

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

MatthewFlamm commented 2 months ago

Id to like to see if we need to do this for observations before publishing a release to avoid multiple breaking change releases.

MatthewFlamm commented 2 months ago

Both detailed forecast and observations already return all values under properties. So this PR also harmonized this package. We are good to release a new version if you have no other planned changes.