Added OpenMeteo Data Fetcher for gridded weather data#204
Open
Sidharth1743 wants to merge 2 commits intoopenclimatefix:mainfrom
Open
Added OpenMeteo Data Fetcher for gridded weather data#204Sidharth1743 wants to merge 2 commits intoopenclimatefix:mainfrom
Sidharth1743 wants to merge 2 commits intoopenclimatefix:mainfrom
Conversation
for more information, see https://pre-commit.ci
Contributor
Author
|
@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 |
Contributor
Author
|
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? |
Contributor
Author
|
@jacobbieker pls review this |
jacobbieker
approved these changes
Feb 20, 2026
Member
jacobbieker
left a comment
There was a problem hiding this comment.
Looks good to me! As for testing the real API, I think its fine mocking it for now, as we don't want to hit the API too much in tests.
| ) -> None: | ||
| """Validate latitude and longitude ranges.""" | ||
| if lat_range[0] >= lat_range[1]: | ||
| raise ValueError("lat_range[0] must be less than lat_range[1]") |
Member
There was a problem hiding this comment.
Could you add the values in the error, in something like the following
Suggested change
| raise ValueError("lat_range[0] must be less than lat_range[1]") | |
| raise ValueError(f"lat_range[0] {lat_range[0]} must be less than lat_range[1] {lat_range[1]}") |
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.
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: