Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
python
test
test_nodedesc.py
Go to the documentation of this file.
1
from
wirecell.dfp
import
nodetype, dot
2
import
pygraphviz
as
pgv
3
4
def
test_nodedesc
():
5
'Make a wirecell.dfp.graph.Graph'
6
7
addtypes =
True
8
rankdir=
'TB'
9
if
addtypes:
10
rankdir=
'LR'
11
12
ag = pgv.AGraph(name=
"nodetypes"
, directed=
True
, strict=
False
, rankdir=rankdir)
13
ag.node_attr[
'shape'
] =
'record'
14
15
j =
open
(
"nodedesc.json"
).
read
()
16
for
typ,dat
in
nodetype.loads(j).items():
17
ag.add_node(typ, label = dot.nodetype_label(dat, addtypes))
18
19
print
ag.string()
20
21
22
if
'__main__'
== __name__:
23
test_nodedesc
()
wirecell.dfp
Definition:
__init__.py:1
open
int open(const char *, int)
Opens a file descriptor.
test_nodedesc
Definition:
test_nodedesc.py:1
read
int read(int, char *, size_t)
Read bytes from a file descriptor.
test_nodedesc.test_nodedesc
def test_nodedesc()
Definition:
test_nodedesc.py:4
Generated by
1.8.11