Skip to content

Commit

Permalink
Update error messages from invalid sub_graph in model instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
JPXKQX committed Aug 8, 2024
1 parent 2069750 commit 73f1ca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Keep it human-readable, your future self will thank you!

### Changed

- New error messages for wrongs graphs.

### Removed

## 0.2.0
Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/models/layers/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def _register_edges(
trainable_size : int
Trainable tensor size
"""
if edge_attributes is None:
raise ValueError("Edge attributes must be provided")
assert sub_graph, f"{self.__class__.__name__} needs a valid sub_graph to register edges."
assert edge_attributes is not None, "Edge attributes must be provided"

edge_attr_tensor = torch.cat([sub_graph[attr] for attr in edge_attributes], axis=1)

Expand Down

0 comments on commit 73f1ca2

Please sign in to comment.