Graph Weather
Data-driven approach for forecasting global weather using graph neural network.
https://github.com/openclimatefix/graph_weather
Category: Atmosphere
Sub Category: Meteorological Observation and Forecast
Keywords
forecasting-models graph-neural-networks pytorch weather
Keywords from Contributors
nowcasting pvoutput solar eumetsat gan nowcasting-models nowcasting-precipitation pytorch-implementation pytorch-lightning
Last synced: about 23 hours ago
JSON representation
Repository metadata
Graph-based weather forecasting models. Originally, PyTorch implementation of Ryan Keisler's 2022 "Forecasting Global Weather with Graph Neural Networks" paper (https://arxiv.org/abs/2202.07575)
- Host: GitHub
- URL: https://github.com/openclimatefix/graph_weather
- Owner: openclimatefix
- License: mit
- Created: 2022-02-21T10:52:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-02T10:34:17.000Z (23 days ago)
- Last Synced: 2025-12-06T14:30:30.987Z (19 days ago)
- Topics: forecasting-models, graph-neural-networks, pytorch, weather
- Language: Python
- Homepage:
- Size: 4.2 MB
- Stars: 276
- Watchers: 4
- Forks: 79
- Open Issues: 73
- Releases: 132
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
Graph Weather
This repo implements graph neural networks for weather forecasting, originally an implementation of
the Graph Weather paper (https://arxiv.org/pdf/2202.07575.pdf) in PyTorch. Additionally, multiple other
models have now been added, as well as general models for assimilation and forecasting.
The models implemented include:
DeepMind's Functional Generative Network (FGN) for probablistic ensemble forecasting
DeepMind's GenCast for graph diffusion-based forecasting
WindBorne's WeatherMesh-3 for highly efficient forecasting with Neighborhood Attention
Microsoft's Aurora forecasting model
And FengWu-GHR forecasting, using LoRA to correct for per-forecast step errors
The components of these models should be fairly modular and be able to be swapped around to experiment with graph-based weather forecasting.
Installation
This library can be installed through
pip install graph-weather
Alternatively, you can install the latest version from the repository easily with pixi:
pixi install # `-e cuda` for GPU support, `-e cpu` for CPU-only
Example Usage
The models generate the graphs internally, so the only thing that needs to be passed to the model is the node features
in the same order as the lat_lons.
import torch
from graph_weather import GraphWeatherForecaster
from graph_weather.models.losses import NormalizedMSELoss
lat_lons = []
for lat in range(-90, 90, 1):
for lon in range(0, 360, 1):
lat_lons.append((lat, lon))
model = GraphWeatherForecaster(lat_lons)
# Generate 78 random features + 24 non-NWP features (i.e. landsea mask)
features = torch.randn((2, len(lat_lons), 102))
target = torch.randn((2, len(lat_lons), 78))
out = model(features)
criterion = NormalizedMSELoss(lat_lons=lat_lons, feature_variance=torch.randn((78,)))
loss = criterion(out, target)
loss.backward()
And for the assimilation model, which assumes each lat/lon point also has a height above ground, and each observation
is a single value + the relative time. The assimlation model also assumes the desired output grid is given to it as
well.
import torch
import numpy as np
from graph_weather import GraphWeatherAssimilator
from graph_weather.models.losses import NormalizedMSELoss
obs_lat_lons = []
for lat in range(-90, 90, 7):
for lon in range(0, 180, 6):
obs_lat_lons.append((lat, lon, np.random.random(1)))
for lon in 360 * np.random.random(100):
obs_lat_lons.append((lat, lon, np.random.random(1)))
output_lat_lons = []
for lat in range(-90, 90, 5):
for lon in range(0, 360, 5):
output_lat_lons.append((lat, lon))
model = GraphWeatherAssimilator(output_lat_lons=output_lat_lons, analysis_dim=24)
features = torch.randn((1, len(obs_lat_lons), 2))
lat_lon_heights = torch.tensor(obs_lat_lons)
out = model(features, lat_lon_heights)
assert not torch.isnan(out).all()
assert out.size() == (1, len(output_lat_lons), 24)
criterion = torch.nn.MSELoss()
loss = criterion(out, torch.randn((1, len(output_lat_lons), 24)))
loss.backward()
Pretrained Weights
Coming soon! We plan to train a model on GFS 0.25 degree operational forecasts, as well as MetOffice NWP forecasts.
We also plan trying out adaptive meshes, and predicting future satellite imagery as well.
Training Data
Training data will be available through HuggingFace Datasets for the GFS forecasts. The initial set of data is available for GFSv16 forecasts, raw observations, and FNL Analysis files from 2016 to 2022, and for ERA5 Reanlaysis. MetOffice NWP forecasts we cannot
redistribute, but can be accessed through CEDA.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Owner metadata
- Name: Open Climate Fix
- Login: openclimatefix
- Email: info@openclimatefix.org
- Kind: organization
- Description: Using open science to mitigate climate change
- Website: openclimatefix.org
- Location: London
- Twitter: openclimatefix
- Company:
- Icon url: https://avatars.githubusercontent.com/u/48357542?v=4
- Repositories: 88
- Last ynced at: 2024-04-15T07:32:15.529Z
- Profile URL: https://github.com/openclimatefix
GitHub Events
Total
- Create event: 26
- Release event: 24
- Issues event: 33
- Watch event: 61
- Issue comment event: 176
- Push event: 127
- Pull request review comment event: 119
- Pull request review event: 57
- Pull request event: 31
- Fork event: 26
Last Year
- Create event: 26
- Release event: 24
- Issues event: 32
- Watch event: 43
- Issue comment event: 175
- Push event: 117
- Pull request review comment event: 119
- Pull request review event: 57
- Pull request event: 31
- Fork event: 23
Committers metadata
Last synced: 11 days ago
Total Commits: 282
Total Committers: 20
Avg Commits per committer: 14.1
Development Distribution Score (DDS): 0.528
Commits in past year: 79
Committers in past year: 11
Avg Commits per committer in past year: 7.182
Development Distribution Score (DDS) in past year: 0.506
| Name | Commits | |
|---|---|---|
| BumpVersion Action | b****n@g****s | 133 |
| Jacob Bieker | j****b@b****h | 83 |
| allcontributors[bot] | 4****]@u****m | 22 |
| pre-commit-ci[bot] | 6****]@u****m | 11 |
| gbruno16 | 7****6@u****m | 7 |
| Lorenzo Breschi | 5****d@u****m | 4 |
| Yuvraaj Narula | 4****a@u****m | 4 |
| KAITE | a****2@g****m | 3 |
| Aavash Subedi | 8****i@u****m | 2 |
| Indranil Biswas | i****7@g****m | 2 |
| Rahul Maurya | 9****b@u****m | 2 |
| Ananya Kulkarni | 1****k@u****m | 1 |
| Aniket Shaha | 6****5@u****m | 1 |
| Francesco | 3****a@u****m | 1 |
| Jacob Prince-Bieker | j****b@j****i | 1 |
| Ramkumar R | r****l@g****m | 1 |
| Vishal Gaur | 3****t@u****m | 1 |
| Wendoom-dev | i****a@g****m | 1 |
| assafshouval | a****l@g****m | 1 |
| peterdudfield | p****d@h****m | 1 |
Committer domains:
- jua.ai: 1
- bieker.tech: 1
Issue and Pull Request metadata
Last synced: 6 days ago
Total issues: 95
Total pull requests: 113
Average time to close issues: 4 months
Average time to close pull requests: 26 days
Total issue authors: 24
Total pull request authors: 24
Average comments per issue: 3.05
Average comments per pull request: 0.96
Merged pull request: 82
Bot issues: 1
Bot pull requests: 31
Past year issues: 21
Past year pull requests: 40
Past year average time to close issues: 26 days
Past year average time to close pull requests: about 1 month
Past year issue authors: 4
Past year pull request authors: 12
Past year average comments per issue: 3.57
Past year average comments per pull request: 1.78
Past year merged pull request: 19
Past year bot issues: 0
Past year bot pull requests: 4
Top Issue Authors
- jacobbieker (62)
- paapu88 (4)
- gbruno16 (3)
- byphilipp (2)
- vitusbenson (2)
- JackKelly (2)
- taeyoon91 (2)
- rahul-maurya11b (2)
- SauryChen (1)
- Wonderdch (1)
- allcontributors[bot] (1)
- DarkSlice1 (1)
- maziheng31 (1)
- marvingabler (1)
- ammoniaca (1)
Top Pull Request Authors
- pre-commit-ci[bot] (19)
- yuvraajnarula (17)
- jacobbieker (14)
- gbruno16 (14)
- allcontributors[bot] (12)
- rnwzd (8)
- rahul-maurya11b (3)
- aavashsubedi (3)
- aniket2405 (2)
- Wendoom-dev (2)
- peterdudfield (2)
- AswaniSahoo (2)
- praj-tarun (2)
- ACSE-vg822 (2)
- 0xFrama (2)
Top Issue Labels
- enhancement (64)
- good first issue (24)
- bug (14)
- help wanted (4)
- size-big (1)
Top Pull Request Labels
- enhancement (5)
- size-small (2)
- documentation (1)
- size-big (1)
Package metadata
- Total packages: 2
-
Total downloads:
- pypi: 270 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 230
- Total maintainers: 2
proxy.golang.org: github.com/openclimatefix/graph_weather
- Homepage:
- Documentation: https://pkg.go.dev/github.com/openclimatefix/graph_weather#section-documentation
- Licenses: mit
- Latest release: v1.0.124 (published 10 days ago)
- Last Synced: 2025-12-21T22:09:09.542Z (4 days ago)
- Versions: 132
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: graph-weather
Weather Forecasting with Graph Neural Networks
- Homepage: https://github.com/openclimatefix/graph_weather
- Documentation: https://graph-weather.readthedocs.io/
- Licenses: MIT License
- Latest release: 1.0.94 (published 11 months ago)
- Last Synced: 2025-12-21T22:09:07.979Z (4 days ago)
- Versions: 98
- Dependent Packages: 0
- Dependent Repositories: 1
- Downloads: 270 Last month
-
Rankings:
- Stargazers count: 6.814%
- Dependent packages count: 7.306%
- Forks count: 8.016%
- Average: 14.844%
- Dependent repos count: 22.077%
- Downloads: 30.008%
- Maintainers (2)
Dependencies
- datasets *
- einops *
- h3 *
- huggingface-hub *
- torch *
- torch-geometric *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v2 composite
- ubuntu latest build
- datasets *
- einops *
- fsspec *
- huggingface-hub *
- pysolar *
- pytorch-lightning *
- torch-geometric-temporal *
Score: 14.460275990941378