Skip to content
Snippets Groups Projects
Commit 988f10a6 authored by Markus Holzer's avatar Markus Holzer
Browse files

Added test case for dot printer

parent 6e83dfb5
No related branches found
No related tags found
1 merge request!203Extended Test suit
......@@ -60,8 +60,6 @@ def __shortened(node):
return f"Func: {node.function_name} ({','.join(param_names)})"
elif isinstance(node, SympyAssignment):
return repr(node.lhs)
elif isinstance(node, Block):
return "Block" + str(id(node))
elif isinstance(node, Conditional):
return repr(node)
else:
......
%% Cell type:code id: tags:
``` python
from pystencils.session import *
from pystencils.astnodes import Block, Conditional
```
%% Cell type:code id: tags:
``` python
src, dst = ps.fields("src, dst: double[2D]", layout='c')
true_block = Block([ps.Assignment(dst[0, 0], src[-1, 0])])
false_block = Block([ps.Assignment(dst[0, 0], src[1, 0])])
ur = [true_block, Conditional(dst.center() > 0.0, true_block, false_block)]
ast = ps.create_kernel(ur)
```
%% Cell type:code id: tags:
``` python
ps.to_dot(ast, graph_style={'size': "9.5,12.5"})
```
%% Output
<graphviz.files.Source at 0x7f0863cebc10>
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment