Skip to content

Commit

Permalink
fix: nodes without attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
JPXKQX committed Aug 21, 2024
1 parent c28e977 commit db43638
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/anemoi/graphs/plotting/interactive_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def plot_interactive_nodes(graph: HeteroData, nodes_name: str, out_file: Optiona
# Remove x to avoid plotting the coordinates as an attribute
node_attrs.remove("x")

if len(node_attrs) == 0:
LOGGER.warning(f"No node attributes found for {nodes_name} nodes.")
return

node_traces = {}
for node_attr in node_attrs:
node_attr_values = graph[nodes_name][node_attr].float().numpy()
Expand Down

0 comments on commit db43638

Please sign in to comment.