graph_weather

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)

https://github.com/openclimatefix/graph_weather

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, nature.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary

Keywords

forecasting-models graph-neural-networks pytorch weather

Keywords from Contributors

pytorch-lightning pytorch-implementation nowcasting-precipitation nowcasting-models nowcasting gan eumetsat particles battery climate-model
Last synced: 6 months ago · JSON representation

Repository

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)

Basic Info
  • Host: GitHub
  • Owner: openclimatefix
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 4.19 MB
Statistics
  • Stars: 257
  • Watchers: 4
  • Forks: 76
  • Open Issues: 68
  • Releases: 127
Topics
forecasting-models graph-neural-networks pytorch weather
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

Graph Weather

All Contributors <!-- ALL-CONTRIBUTORS-BADGE:END -->

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

bash pip install graph-weather

Alternatively, you can install the latest version from the repository easily with pixi:

bash 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.

```python import torch from graphweather import GraphWeatherForecaster from graphweather.models.losses import NormalizedMSELoss

latlons = [] for lat in range(-90, 90, 1): for lon in range(0, 360, 1): latlons.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(latlons=latlons, 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.

```python import torch import numpy as np from graphweather import GraphWeatherAssimilator from graphweather.models.losses import NormalizedMSELoss

obslatlons = [] for lat in range(-90, 90, 7): for lon in range(0, 180, 6): obslatlons.append((lat, lon, np.random.random(1))) for lon in 360 * np.random.random(100): obslatlons.append((lat, lon, np.random.random(1)))

outputlatlons = [] for lat in range(-90, 90, 5): for lon in range(0, 360, 5): outputlatlons.append((lat, lon)) model = GraphWeatherAssimilator(outputlatlons=outputlatlons, analysis_dim=24)

features = torch.randn((1, len(obslatlons), 2)) latlonheights = torch.tensor(obslatlons) out = model(features, latlonheights) assert not torch.isnan(out).all() assert out.size() == (1, len(outputlatlons), 24)

criterion = torch.nn.MSELoss() loss = criterion(out, torch.randn((1, len(outputlatlons), 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):

Jacob Bieker
Jacob Bieker

💻
Jack Kelly
Jack Kelly

🤔
byphilipp
byphilipp

🤔
Markus Kaukonen
Markus Kaukonen

💬
MoHawastaken
MoHawastaken

🐛
Mihai
Mihai

💬
Vitus Benson
Vitus Benson

🐛
dongZheX
dongZheX

💬
sabbir2331
sabbir2331

💬
Lorenzo Breschi
Lorenzo Breschi

💻
gbruno16
gbruno16

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Owner

  • Name: Open Climate Fix
  • Login: openclimatefix
  • Kind: organization
  • Email: info@openclimatefix.org
  • Location: London

Using open science to mitigate climate change

GitHub Events

Total
  • Create event: 26
  • Release event: 23
  • Issues event: 30
  • Watch event: 54
  • Issue comment event: 157
  • Push event: 116
  • Pull request review comment event: 115
  • Pull request review event: 52
  • Pull request event: 27
  • Fork event: 25
Last Year
  • Create event: 26
  • Release event: 23
  • Issues event: 30
  • Watch event: 54
  • Issue comment event: 157
  • Push event: 116
  • Pull request review comment event: 115
  • Pull request review event: 52
  • Pull request event: 27
  • Fork event: 25

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 272
  • Total Committers: 17
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.529
Past Year
  • Commits: 73
  • Committers: 10
  • Avg Commits per committer: 7.3
  • Development Distribution Score (DDS): 0.507
Top Committers
Name Email Commits
BumpVersion Action b****n@g****s 128
Jacob Bieker j****b@b****h 84
allcontributors[bot] 4****] 22
pre-commit-ci[bot] 6****] 11
gbruno16 7****6 7
Lorenzo Breschi 5****d 4
Yuvraaj Narula 4****a 4
Aavash Subedi 8****i 2
Rahul Maurya 9****b 2
Ananya Kulkarni 1****k 1
Aniket Shaha 6****5 1
Francesco 3****a 1
Vishal Gaur 3****t 1
Wendoom-dev i****a@g****m 1
assafshouval a****l@g****m 1
peterdudfield p****d@h****m 1
KAITE a****2@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 93
  • Total pull requests: 111
  • Average time to close issues: 4 months
  • Average time to close pull requests: 26 days
  • Total issue authors: 24
  • Total pull request authors: 21
  • Average comments per issue: 2.71
  • Average comments per pull request: 0.89
  • Merged pull requests: 83
  • Bot issues: 1
  • Bot pull requests: 32
Past Year
  • Issues: 19
  • Pull requests: 39
  • Average time to close issues: 26 days
  • Average time to close pull requests: about 1 month
  • Issue authors: 4
  • Pull request authors: 10
  • Average comments per issue: 3.0
  • Average comments per pull request: 1.54
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
  • jacobbieker (59)
  • 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)
Pull Request Authors
  • pre-commit-ci[bot] (19)
  • yuvraajnarula (15)
  • 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 Labels
Issue Labels
enhancement (61) good first issue (23) bug (14) help wanted (4)
Pull Request Labels
enhancement (5) size-small (2) documentation (1) size-big (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 160 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 225
  • Total maintainers: 2
proxy.golang.org: github.com/openclimatefix/graph_weather
  • Versions: 127
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
pypi.org: graph-weather

Weather Forecasting with Graph Neural Networks

  • Versions: 98
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 160 Last month
Rankings
Stargazers count: 6.8%
Dependent packages count: 7.3%
Forks count: 8.0%
Average: 14.8%
Dependent repos count: 22.1%
Downloads: 30.0%
Maintainers (2)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • datasets *
  • einops *
  • h3 *
  • huggingface-hub *
  • torch *
  • torch-geometric *
.github/workflows/workflows.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite
Dockerfile docker
  • ubuntu latest build
.github/workflows/release.yaml actions
setup.py pypi
environment.yml pypi
  • datasets *
  • einops *
  • fsspec *
  • huggingface-hub *
  • pysolar *
  • pytorch-lightning *
  • torch-geometric-temporal *