Skip to content
Open
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased](https://github.com/mllam/weather-model-graphs/compare/v0.3.0...HEAD)

### Added

- Add `mesh_layout` argument to mesh graph creation functions, with `rectilinear`
as the first supported layout. Uses a two-step architecture separating coordinate
creation from connectivity creation, enabling future alternative layouts (e.g. triangular).
[\#78](https://github.com/mllam/weather-model-graphs/issues/78), @prajwal-tech07

## [v0.3.0](https://github.com/mllam/weather-model-graphs/releases/tag/v0.3.0)

### Added
Expand Down
53 changes: 32 additions & 21 deletions src/weather_model_graphs/create/archetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,20 @@ def create_keisler_graph(
"""
return create_all_graph_components(
coords=coords,
m2m_connectivity="flat",
m2m_connectivity_kwargs=dict(mesh_node_distance=mesh_node_distance),
coords_crs=coords_crs,
graph_crs=graph_crs,
mesh_layout="rectilinear",
mesh_layout_kwargs=dict(mesh_node_spacing=mesh_node_distance),
g2m_connectivity="within_radius",
m2g_connectivity="nearest_neighbours",
g2m_connectivity_kwargs=dict(
rel_max_dist=0.51,
),
m2m_connectivity="flat",
m2m_connectivity_kwargs=dict(pattern="8-star"),
m2g_connectivity="nearest_neighbours",
m2g_connectivity_kwargs=dict(
max_num_neighbours=4,
),
coords_crs=coords_crs,
graph_crs=graph_crs,
decode_mask=decode_mask,
return_components=return_components,
)
Expand Down Expand Up @@ -132,22 +134,26 @@ def create_graphcast_graph(
"""
return create_all_graph_components(
coords=coords,
m2m_connectivity="flat_multiscale",
m2m_connectivity_kwargs=dict(
mesh_node_distance=mesh_node_distance,
level_refinement_factor=level_refinement_factor,
max_num_levels=max_num_levels,
coords_crs=coords_crs,
graph_crs=graph_crs,
mesh_layout="rectilinear",
mesh_layout_kwargs=dict(
mesh_node_spacing=mesh_node_distance,
refinement_factor=level_refinement_factor,
max_num_refinement_levels=max_num_levels,
),
g2m_connectivity="within_radius",
m2g_connectivity="nearest_neighbours",
g2m_connectivity_kwargs=dict(
rel_max_dist=0.51,
),
m2m_connectivity="flat_multiscale",
m2m_connectivity_kwargs=dict(
pattern="8-star",
),
m2g_connectivity="nearest_neighbours",
m2g_connectivity_kwargs=dict(
max_num_neighbours=4,
),
coords_crs=coords_crs,
graph_crs=graph_crs,
decode_mask=decode_mask,
return_components=return_components,
)
Expand Down Expand Up @@ -216,22 +222,27 @@ def create_oskarsson_hierarchical_graph(
"""
return create_all_graph_components(
coords=coords,
m2m_connectivity="hierarchical",
m2m_connectivity_kwargs=dict(
mesh_node_distance=mesh_node_distance,
level_refinement_factor=level_refinement_factor,
max_num_levels=max_num_levels,
coords_crs=coords_crs,
graph_crs=graph_crs,
mesh_layout="rectilinear",
mesh_layout_kwargs=dict(
mesh_node_spacing=mesh_node_distance,
refinement_factor=level_refinement_factor,
max_num_refinement_levels=max_num_levels,
),
g2m_connectivity="within_radius",
m2g_connectivity="nearest_neighbours",
g2m_connectivity_kwargs=dict(
rel_max_dist=0.51,
),
m2m_connectivity="hierarchical",
m2m_connectivity_kwargs=dict(
intra_level=dict(pattern="8-star"),
inter_level=dict(pattern="nearest", k=1),
),
m2g_connectivity="nearest_neighbours",
m2g_connectivity_kwargs=dict(
max_num_neighbours=4,
),
coords_crs=coords_crs,
graph_crs=graph_crs,
decode_mask=decode_mask,
return_components=return_components,
)
Loading