Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Maintenance

- Rename the `d_mesh_static` mesh-node static-feature dimension to `num_mesh_static_vars` in comments and docstrings, matching the canonical `num_*` naming. [\#695](https://github.com/mllam/neural-lam/pull/695) @uttam12331

- Add comprehensive type hints to GraphLAM in `neural_lam/models/step_predictors/graph/graph_lam.py` [\#669](https://github.com/mllam/neural-lam/pull/669) @GiGiKoneti

- Add comprehensive type hints to ARForecaster in `neural_lam/models/forecasters/autoregressive.py` [\#663](https://github.com/mllam/neural-lam/pull/663) @GiGiKoneti
Expand Down
6 changes: 3 additions & 3 deletions neural_lam/create_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def create_graph(
- m2m_edge_index.pt list of [2, N_m2m_edges_level], length==n_levels
- m2m_features.pt list of [N_m2m_edges_level, d_features],
length==n_levels
- mesh_features.pt list of [N_mesh_nodes_level, d_mesh_static],
- mesh_features.pt list of [N_mesh_nodes_level, num_mesh_static_vars],
length==n_levels

where
Expand All @@ -296,9 +296,9 @@ def create_graph(
N_m2m_edges_level:
number of edges in the graph from mesh-to-mesh at a given level
(list index corresponds to the level)
d_mesh_static:
num_mesh_static_vars:
number of static features per mesh node (currently
d_mesh_static==2, for x and y)
num_mesh_static_vars==2, for x and y)
N_mesh_nodes_level:
number of nodes in the mesh at a given level

Expand Down
2 changes: 1 addition & 1 deletion neural_lam/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def loads_file(fn: str) -> Any:
# Load static node features
mesh_static_features = loads_file(
"mesh_features.pt"
) # List of (N_mesh[l], d_mesh_static)
) # List of (N_mesh[l], num_mesh_static_vars)

# Load edges (edge_index)
m2m_edge_index = BufferList(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_graph_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_graph_creation(datastore_name, graph_name):
# TODO: check that the number of edges is consistent over the files, for
# now we just check the number of features
d_features = 3
d_mesh_static = 2
num_mesh_static_vars = 2

with tempfile.TemporaryDirectory() as tmpdir:
graph_dir_path = Path(tmpdir) / "graph" / graph_name
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_graph_creation(datastore_name, graph_name):
assert isinstance(r, torch.Tensor)

if file_id == "mesh_features":
assert r.shape[1] == d_mesh_static
assert r.shape[1] == num_mesh_static_vars
elif file_id.endswith("_index"):
assert r.shape[0] == 2 # adjacency matrix uses two rows
elif file_id.endswith("_features"):
Expand Down
Loading