graph_weather icon indicating copy to clipboard operation
graph_weather copied to clipboard

Added OpenMeteo Data Fetcher for gridded weather data

Open Sidharth1743 opened this issue 10 months ago • 3 comments

Pull Request

Description

This PR implements the OpenMeteoWeatherDataFetcher to enable fetching gridded weather data from the OpenMeteo API This fetcher is designed to integrate seamlessly with the Graph Weather pipeline by returning properly structured in xarray format Dataset objects : Latitude, Longitude, Time

Generates lat/lon meshgrids and aggregates batched API responses into a single 3D xarray.Dataset Supports both Forecast and Historical OpenMeteo endpoints Includes a token bucket RateLimiter (respecting free-tier limits) and exponential backoff retries Includes Zarr based caching and threaded parallel fetching Supports custom NWP models, resolution, and hourly parameters

Fixes #90

How Has This Been Tested?

test suite in tests/data/test_openmeteo_fetcher.py

Grid Verification: Verified fetch_forecast returns data with multiple latitude/longitude points (gridded) and correct dimensions Structure: Verified output is an xarray.Dataset with latitude, longitude, and time_utc coordinates Logic: Verified rate limiting, batching (50 coords/request), and date validation logic [x] Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check? [x] Yes

Checklist:

  • [ x] My code follows OCF's coding style guidelines
  • [ x] I have performed a self-review of my own code
  • [ x] I have made corresponding changes to the documentation
  • [ x] I have added tests that prove my fix is effective or that my feature works
  • [ x] I have checked my code and corrected any misspellings

Sidharth1743 avatar Jan 16 '26 13:01 Sidharth1743

@jacobbieker i have made some changes and includes only some of the parameters from openmeteo api. is that okay? or need to include all of the params

Sidharth1743 avatar Jan 16 '26 13:01 Sidharth1743

also in the test i have only mocked the api. is this approach OK here or would you prefer an integration test with the real API as well?

Sidharth1743 avatar Jan 16 '26 13:01 Sidharth1743

@jacobbieker pls review this

Sidharth1743 avatar Jan 19 '26 03:01 Sidharth1743