Skip to content

Commit

Permalink
work on graph
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Jun 15, 2024
1 parent 6ede607 commit 43a6e22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/anemoi/inference/checkpoint/metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,13 @@ def digraph(self, label_maker=lambda x: dict(label=x.kind)):

for node, label in nodes.items():
for k, v in label.items():
# Use json.dumps to escape special characters
label[k] = json.dumps(v)

if isinstance(v, str) and v.startswith("<") and v.endswith(">"):
# Skip HTML labels
pass
else:
# Use json.dumps to escape special characters
label[k] = json.dumps(v)

label = " ".join([f"{k}={v}" for k, v in label.items()])

Expand Down

0 comments on commit 43a6e22

Please sign in to comment.