Functions
wirecell.img.tap Namespace Reference

Functions

def load (filename)
 

Detailed Description

Load in a graph from a JsonClusterTap JSON file

Function Documentation

def wirecell.img.tap.load (   filename)

Definition at line 8 of file tap.py.

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 
18 
int open(const char *, int)
Opens a file descriptor.
def load(filename)
Definition: tap.py:8