Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
python
wirecell
img
tap.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
'''
3
Load in a graph from a JsonClusterTap JSON file
4
'''
5
6
import
json
7
8
def
load
(filename):
9
dat = json.load(
open
(filename))
10
import
networkx
as
nx
11
gr = nx.Graph(filename=filename)
12
for
vtx
in
dat[
'vertices'
]:
13
gr.add_node(vtx[
'ident'
], code=vtx[
'type'
], **vtx[
'data'
])
14
for
edge
in
dat[
'edges'
]:
15
gr.add_edge(*edge)
16
return
gr
17
open
int open(const char *, int)
Opens a file descriptor.
wirecell.img.tap.load
def load(filename)
Definition:
tap.py:8
Generated by
1.8.11