Skip to content

Commit dd7739d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 16326d9 commit dd7739d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

graphs/src/anemoi/graphs/inspect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@ def inspect(self):
9090
if self.show_nodes:
9191
LOGGER.info("Saving interactive plots of nodes ...")
9292
for nodes_name in self.graph.node_types:
93-
plot_interactive_nodes_2d(self.graph, nodes_name, out_file=self.output_path / f"{nodes_name}_nodes.html")
93+
plot_interactive_nodes_2d(
94+
self.graph, nodes_name, out_file=self.output_path / f"{nodes_name}_nodes.html"
95+
)

graphs/src/anemoi/graphs/plotting/interactive_3d.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,4 +953,4 @@ nor does it submit to any jurisdiction. #}
953953
</script>
954954
</body>
955955

956-
</html>
956+
</html>

graphs/src/anemoi/graphs/plotting/interactive_3d_html.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
import numpy as np
1313
import torch
14-
from torch_geometric.data import HeteroData
1514
from jinja2 import Template
15+
from torch_geometric.data import HeteroData
1616

1717
HTML_TEMPLATE_PATH = Path(__file__).parent / "interactive_3d.html.jinja"
1818

@@ -59,7 +59,7 @@ def subset_graph(
5959
edges_keys = graph.edge_types
6060

6161
out_nodes = {n: graph[n].x for n in nodes}
62-
out_edges = {"_".join(e) : graph[e].edge_index for e in edges_keys}
62+
out_edges = {"_".join(e): graph[e].edge_index for e in edges_keys}
6363

6464
return out_nodes, out_edges
6565

@@ -83,6 +83,7 @@ def to_edges_json(names1, names2, pairs):
8383
edges = [[names1[i], names2[j]] for i, j in pairs]
8484
return edges
8585

86+
8687
def plot_interactive_graph_3d(
8788
graph: HeteroData,
8889
out_file: str | Path,
@@ -140,4 +141,4 @@ def plot_interactive_graph_3d(
140141
template = Template(HTML_TEMPLATE)
141142
html_output = template.render(nodes=nodes_embed, edges=edges_embed, max_degree=50, min_degree=1)
142143
with open(out_file, "w") as f:
143-
f.write(html_output)
144+
f.write(html_output)

0 commit comments

Comments
 (0)