Skip to content

Commit 2b374c4

Browse files
committed
format tree handles undirected edges better
1 parent 0aaaa19 commit 2b374c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mathicsscript/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def hierarchy_pos(
119119

120120
# These get swapped if tree edge directions point to the root.
121121
decendants = nx.descendants
122-
out_degree = G.out_degree
122+
out_degree = G.out_degree if hasattr(G, "out_degree") else G.degree
123123
neighbors = G.neighbors
124124

125125
if root is None:

0 commit comments

Comments
 (0)