Skip to content

Commit 2fbfe43

Browse files
committed
FIX(plot): Nets were not plotting Inps/Outs/Name ...
due to forgotten _replace() assignment.
1 parent a9a76af commit 2fbfe43

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

graphtik/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ def __repr__(self):
942942

943943
def prepare_plot_args(self, plot_args: PlotArgs) -> PlotArgs:
944944
plot_args = plot_args.clone_or_merge_graph(self.graph)
945-
plot_args.with_defaults(
945+
plot_args = plot_args.with_defaults(
946946
name=f"network-x{len(self.graph.nodes)}-nodes",
947947
inputs=self.needs,
948948
outputs=self.provides,

test/test_plot.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from operator import add
99

1010
import dill
11+
import networkx as nx
1112
import pytest
1213

1314
from graphtik import base, compose, network, operation, plot
@@ -16,8 +17,8 @@
1617
from graphtik.plot import (
1718
Plotter,
1819
Style,
19-
get_active_plotter,
2020
active_plotter_plugged,
21+
get_active_plotter,
2122
)
2223

2324

@@ -433,8 +434,8 @@ def test_node_dot_str0(dot_str_pipeline):
433434
fontname=italic;
434435
label=<graph>;
435436
splines=ortho;
436-
<edge> [shape=rect];
437-
<digraph&#58; strict> [shape=rect];
437+
<edge> [shape=invhouse];
438+
<digraph&#58; strict> [shape=invhouse];
438439
<node> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
439440
<TR>
440441
<TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name=&#x27;node&#x27;, needs=[&#x27;edge&#x27;, &#x27;digraph: strict&#x27;], provides=[&#x27;&lt;graph&gt;&#x27;], fn=&#x27;add&#x27;)" TARGET=""
@@ -444,7 +445,7 @@ def test_node_dot_str0(dot_str_pipeline):
444445
><B>FN:</B> &lt;built-in function add&gt;</TD>
445446
</TR>
446447
</TABLE>>, shape=plain, tooltip=<node>];
447-
<&lt;graph&gt;> [shape=rect];
448+
<&lt;graph&gt;> [shape=house];
448449
<cu&#58;sto&#58;m> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
449450
<TR>
450451
<TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name=&#x27;cu:sto:m&#x27;, needs=[&#x27;edge&#x27;, &#x27;digraph: strict&#x27;], provides=[&#x27;&lt;graph&gt;&#x27;], fn=&#x27;func&#x27;)" TARGET=""
@@ -483,8 +484,8 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch):
483484
fontname=italic;
484485
label=<graph>;
485486
splines=ortho;
486-
<edge> [shape=rect];
487-
<digraph&#58; strict> [shape=rect];
487+
<edge> [shape=invhouse];
488+
<digraph&#58; strict> [shape=invhouse];
488489
<node> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
489490
<TR>
490491
<TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name=&#x27;node&#x27;, needs=[&#x27;edge&#x27;, &#x27;digraph: strict&#x27;], provides=[&#x27;&lt;graph&gt;&#x27;], fn=&#x27;add&#x27;)" HREF="abc#{&#x27;dot_path&#x27;: &#x27;_operator.add&#x27;, &#x27;posix_path&#x27;: &#x27;_operator/add&#x27;}" TARGET="bad"
@@ -494,7 +495,7 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch):
494495
><B>FN:</B> &lt;built-in function add&gt;</TD>
495496
</TR>
496497
</TABLE>>, shape=plain, tooltip=<node>];
497-
<&lt;graph&gt;> [shape=rect];
498+
<&lt;graph&gt;> [shape=house];
498499
<cu&#58;sto&#58;m> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
499500
<TR>
500501
<TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name=&#x27;cu:sto:m&#x27;, needs=[&#x27;edge&#x27;, &#x27;digraph: strict&#x27;], provides=[&#x27;&lt;graph&gt;&#x27;], fn=&#x27;func&#x27;)" HREF="abc#{&#x27;dot_path&#x27;: &#x27;test.test_plot.func&#x27;, &#x27;posix_path&#x27;: &#x27;test/test_plot/func&#x27;}" TARGET="bad"

0 commit comments

Comments
 (0)