|
14 | 14 | from graphtik import base, compose, network, operation, plot |
15 | 15 | from graphtik.modifiers import optional |
16 | 16 | from graphtik.netop import NetworkOperation |
17 | | -from graphtik.network import yield_ops |
18 | 17 | from graphtik.plot import ( |
19 | 18 | Plotter, |
20 | 19 | Style, |
@@ -407,7 +406,7 @@ def test_plotter_dill(): |
407 | 406 | dill.dumps(plotter) |
408 | 407 |
|
409 | 408 |
|
410 | | -def func(): |
| 409 | +def func(a, b): |
411 | 410 | pass |
412 | 411 |
|
413 | 412 |
|
@@ -452,7 +451,7 @@ def test_node_dot_str0(dot_str_pipeline): |
452 | 451 | <TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name='cu:sto:m', needs=['edge', 'digraph: strict'], provides=['<graph>'], fn='func')" TARGET="" |
453 | 452 | ><B>OP:</B> <I>cu:sto:m</I></TD> |
454 | 453 | </TR><TR> |
455 | | - <TD ALIGN="left" TOOLTIP="def func(): pass" TARGET="" |
| 454 | + <TD ALIGN="left" TOOLTIP="def func(a, b): pass" TARGET="" |
456 | 455 | ><B>FN:</B> test.test_plot.func</TD> |
457 | 456 | </TR> |
458 | 457 | </TABLE>>, shape=plain, tooltip=<cu:sto:m>]; |
@@ -483,29 +482,36 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch): |
483 | 482 | overlay = nx.DiGraph() |
484 | 483 | hidden_op = dot_str_pipeline.net.find_op_by_name("node") |
485 | 484 | overlay.add_node(hidden_op, _no_plot=True) |
486 | | - dot_str = str(dot_str_pipeline.plot(graph=overlay)) |
| 485 | + |
| 486 | + sol = dot_str_pipeline.compute({"edge": 1, "digraph: strict": 2}) |
| 487 | + dot_str = str(sol.plot(graph=overlay)) |
| 488 | + |
487 | 489 | print(dot_str) |
488 | 490 | exp = """ |
489 | | - digraph graph_ { |
| 491 | + digraph solution_x5_nodes { |
490 | 492 | fontname=italic; |
491 | | - label=<graph>; |
492 | 493 | splines=ortho; |
493 | | - <edge> [shape=invhouse]; |
494 | | - <digraph: strict> [shape=invhouse]; |
495 | | - <<graph>> [shape=house]; |
496 | | - <cu:sto:m> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded"> |
| 494 | + subgraph "cluster_after pruning" { |
| 495 | + label="after pruning"; |
| 496 | + <edge> [fillcolor=wheat, shape=invhouse, style=filled, tooltip="(int) 1"]; |
| 497 | + <digraph: strict> [fillcolor=wheat, shape=invhouse, style=filled, tooltip="(int) 2"]; |
| 498 | + <<graph>> [fillcolor=SkyBlue, shape=house, style=filled, tooltip=None]; |
| 499 | + <cu:sto:m> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded" BGCOLOR="wheat"> |
497 | 500 | <TR> |
498 | 501 | <TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name='cu:sto:m', needs=['edge', 'digraph: strict'], provides=['<graph>'], fn='func')" HREF="abc#{'dot_path': 'test.test_plot.func', 'posix_path': 'test/test_plot/func'}" TARGET="bad" |
499 | 502 | ><B>OP:</B> <I>cu:sto:m</I></TD> |
500 | 503 | </TR><TR> |
501 | | - <TD ALIGN="left" TOOLTIP="def func(): pass" HREF="abc#{'dot_path': 'test.test_plot.func', 'posix_path': 'test/test_plot/func'}" TARGET="bad" |
| 504 | + <TD ALIGN="left" TOOLTIP="def func(a, b): pass" HREF="abc#{'dot_path': 'test.test_plot.func', 'posix_path': 'test/test_plot/func'}" TARGET="bad" |
502 | 505 | ><B>FN:</B> test.test_plot.func</TD> |
503 | 506 | </TR> |
504 | 507 | </TABLE>>, shape=plain, tooltip=<cu:sto:m>]; |
| 508 | + } |
| 509 | +
|
505 | 510 | <edge> -> <cu:sto:m>; |
506 | 511 | <digraph: strict> -> <cu:sto:m>; |
507 | 512 | <cu:sto:m> -> <<graph>>; |
508 | 513 | legend [URL="https://graphtik.readthedocs.io/en/latest/_images/GraphtikLegend.svg", fillcolor=yellow, shape=component, style=filled, target=_top]; |
509 | 514 | } |
510 | 515 | """ |
511 | 516 | assert _striplines(dot_str) == _striplines(exp) |
| 517 | + assert "<node>" not in dot_str |
0 commit comments