Skip to content

Commit

Permalink
fix: None node might appear in topological order with only one refere…
Browse files Browse the repository at this point in the history
…nce ...
  • Loading branch information
thvitt committed Jul 25, 2020
1 parent 4885b30 commit f82910f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/macrogen/graph.py
Expand Up @@ -759,12 +759,13 @@ def order_graph(self, graph: nx.MultiDiGraph) -> nx.MultiDiGraph:
for u, v, k, attr in result.edges(keys=True, data=True):
attr['weight'] = 0

for u, v in windowed(ref_order, 2):
if result.has_edge(u, v, 0):
result[u][v][0]['weight'] = 100
result[u][v][0]['topo'] = True
else:
result.add_edge(u, v, penwidth=0, dir='none', weight=100, topo=True)
if len(ref_order) > 1:
for u, v in windowed(ref_order, 2):
if result.has_edge(u, v, 0):
result[u][v][0]['weight'] = 100
result[u][v][0]['topo'] = True
else:
result.add_edge(u, v, penwidth=0, dir='none', weight=100, topo=True)
return result


Expand Down

0 comments on commit f82910f

Please sign in to comment.