Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error messages from invalid sub_graph in model instantiation #24

Closed
wants to merge 1 commit into from
Closed
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 @@ -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
Loading