Skip to content

Commit ee77fbc

Browse files
committed
FIX(plot): iterating node/edge data werre ignored ...
due to `networkx` API misuse.
1 parent 2f3b6fa commit ee77fbc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

graphtik/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def build_pydot(self, plot_args: PlotArgs) -> pydot.Dot:
589589
## NODES
590590
#
591591
base_node_args = node_args = NodeArgs(dot=dot, clustered={})
592-
for nx_node, data in graph.nodes(data=True):
592+
for nx_node, data in graph.nodes.data(True):
593593
node_args = base_node_args._replace(nx_node=nx_node, node_attrs=data)
594594

595595
dot_node = self._make_node(plot_args, node_args)
@@ -600,7 +600,7 @@ def build_pydot(self, plot_args: PlotArgs) -> pydot.Dot:
600600

601601
## EDGES
602602
#
603-
for src, dst, data in graph.edges(data=True):
603+
for src, dst, data in graph.edges.data(True):
604604
src_name = get_node_name(src)
605605
dst_name = get_node_name(dst)
606606

test/test_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_op_node_props():
233233
def _collect_op_props(netop):
234234
return {
235235
k.name: v
236-
for k, v in netop.net.graph.nodes(data=True)
236+
for k, v in netop.net.graph.nodes.data(True)
237237
if isinstance(k, Operation)
238238
}
239239

0 commit comments

Comments
 (0)