ecmwf/anemoi-graphs

18 stars Python 10 components 3 connections

Graph generation library for weather forecasting neural networks

Configuration drives instantiation of node builders and edge builders, which populate a PyTorch Geometric HeteroData graph structure

Under the hood, the system uses 2 data pools, 4 control points to manage its runtime behavior.

Structural Verdict

A 10-component weather climate with 3 connections. 57 files analyzed. Loosely coupled — components are relatively independent.

How Data Flows Through the System

Configuration drives instantiation of node builders and edge builders, which populate a PyTorch Geometric HeteroData graph structure

  1. Config Loading — Parse YAML configuration using Hydra and DotDict
  2. Node Generation — Instantiate node builders to create spherical tessellation points (config: nodes)
  3. Edge Generation — Instantiate edge builders to create connectivity patterns (config: edges)
  4. Graph Assembly — Combine nodes and edges into HeteroData structure
  5. Serialization — Save graph as PyTorch .pt file

System Behavior

How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

HeteroData Graph (in-memory)
PyTorch Geometric heterogeneous graph with nodes and edges
Serialized Graph (file-store)
Saved .pt files containing complete graph structures

Control Points

Technology Stack

PyTorch Geometric (framework)
Graph neural network data structures
H3 (library)
Hexagonal tessellation of the sphere
trimesh (library)
Triangular mesh processing
networkx (library)
Graph data structures and algorithms
scikit-learn (library)
KNN and spatial algorithms
Hydra (framework)
Configuration management and dependency injection
healpy (library)
Spherical harmonics and HEALPix pixelization
netCDF4 (library)
Reading ICON mesh files

Key Components

Science Pipeline

  1. Coordinate Generation — Generate lat-lon coordinates from icosahedral tessellation src/anemoi/graphs/generate/hex_icosahedron.py
  2. Coordinate Transformation — Convert between Cartesian and spherical coordinates [(N, 3) or (N, 2) → (N, 2) or (N, 3)] src/anemoi/graphs/generate/transforms.py
  3. Spatial Indexing — Build KNN index for nearest neighbor searches [(N, 3) → (N, K)] src/anemoi/graphs/edges/builder.py
  4. Edge Attribute Computation — Calculate distances and directional features between connected nodes [(E, 2) → (E, F)] src/anemoi/graphs/edges/attributes.py
  5. Graph Assembly — Combine nodes and edges into HeteroData structure [various tensors → HeteroData] src/anemoi/graphs/create.py

Assumptions & Constraints

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Weather Climate Repositories

Frequently Asked Questions

What is anemoi-graphs used for?

Graph generation library for weather forecasting neural networks ecmwf/anemoi-graphs is a 10-component weather climate written in Python. Loosely coupled — components are relatively independent. The codebase contains 57 files.

How is anemoi-graphs architected?

anemoi-graphs is organized into 5 architecture layers: CLI Interface, Graph Creation, Node Builders, Edge Builders, and 1 more. Loosely coupled — components are relatively independent. This layered structure keeps concerns separated and modules independent.

How does data flow through anemoi-graphs?

Data moves through 5 stages: Config Loading → Node Generation → Edge Generation → Graph Assembly → Serialization. Configuration drives instantiation of node builders and edge builders, which populate a PyTorch Geometric HeteroData graph structure This pipeline design reflects a complex multi-stage processing system.

What technologies does anemoi-graphs use?

The core stack includes PyTorch Geometric (Graph neural network data structures), H3 (Hexagonal tessellation of the sphere), trimesh (Triangular mesh processing), networkx (Graph data structures and algorithms), scikit-learn (KNN and spatial algorithms), Hydra (Configuration management and dependency injection), and 2 more. A focused set of dependencies that keeps the build manageable.

What system dynamics does anemoi-graphs have?

anemoi-graphs exhibits 2 data pools (HeteroData Graph, Serialized Graph), 4 control points. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does anemoi-graphs use?

4 design patterns detected: Builder Pattern, Plugin Architecture, Template Method, Command Pattern.

Analyzed on March 31, 2026 by CodeSea. Written by .