ryansurf / cli-surf

Get surf and ocean data from the command line interface
MIT License
18 stars 30 forks source link

Feature: Add Historical Weather Data Comparison #148

Open AITMAR-TAFE opened 2 weeks ago

AITMAR-TAFE commented 2 weeks ago

Description

I propose adding a feature that allows users to view weather data from exactly one year ago alongside current weather conditions. Related to PR nr #152 . This feature will improve user experience by allowing to compare weather data from one year ago.

Use Cases

Users can see how current weather conditions compare to those from the same time last year, helping them understand if this weather is typical for this time of year or abnormal.

Proposed Implementation

  1. Fetch Historical Weather Data from the API: Create a new function in api.py, e.g., get_uv_history and ocean_information_history, to retrieve historical weather data for the same date last year using a weather API.
  2. Integrate Historical Data Retrieval: Within the run function, after obtaining the current weather data, call the new get_uv_history and ocean_information_history, function to get the historical data.
  3. Combine Current and Historical Data: Modify the gather_data function to combine the current and historical data into a single output structure.
  4. Update Output Functions: Adjust the helper.py functions (e.g., print_outputs, print_ocean_data) to include historical data in the output format, allowing users to see both current and last year's weather conditions. Also created a new function print_historical_data.
  5. Testing: Create tests to validate the new functionality
  6. Update documentation

Example

Current Output Example

Location: Perth

      .-``'.
    .`   .`
_.-'     '._

UV index: 6.8
Wave Height: 5.2
Wave Direction: 250.0
Wave Period: 10.8

Proposed Feature Output Example

Location: Perth

      .-``'.
    .`   .`
_.-'     '._

Current Weather:
UV index: 6.8
Wave Height: 5.2
Wave Direction: 250.0
Wave Period: 10.8

Historical Weather (1 Year Ago):
UV index: 5.2
Wave Height: 4.1
Wave Direction: 230.0
Wave Period: 9.5

Additional Notes

I believe this feature will offer users a valuable comparison of weather conditions from the same time last year, helping them assess whether the current weather is typical for this time of year. Incorporating historical weather data for surf conditions is essential as it allows surfers to understand seasonal variability in wave height and ocean temperatures, which can significantly impact their experience. For example, if surfers see that last year’s wave height on the same date was much higher, they can adjust their expectations and plans accordingly. This feature also provides critical context for discussions around climate change, as users can observe trends, such as warming ocean temperatures, that may affect surf conditions over time. Ultimately, this not only enhances decision-making but also fosters community engagement, encouraging surfers to be more aware of environmental changes and their implications for the sport.

github-actions[bot] commented 2 weeks ago

👋 Hi! Thanks for opening your first issue! • We're excited to see your contribution. • If you find this project helpful, please consider giving it a star ⭐ • Your support means a lot to us! 😊

AITMAR-TAFE commented 2 weeks ago

Hi, I would like to work on this, could @ryansurf assing this to me? Many thanks 🙏

AITMAR-TAFE commented 2 weeks ago

@all-contributors please add @AITMAR-TAFE for code

allcontributors[bot] commented 2 weeks ago

@AITMAR-TAFE

I've put up a pull request to add @AITMAR-TAFE! :tada:

ryansurf commented 2 weeks ago

@AITMAR-TAFE this is super cool, I'd use this myself. Looking forward to reviewing your PR!