|
6 | 6 | # Maintainer: |
7 | 7 | # Created: Fri Mar 8 11:26:13 2013 (+0530) |
8 | 8 | # Version: |
9 | | -# Last-Updated: Sat Aug 6 15:47:37 2016 (-0400) |
10 | | -# By: subha |
11 | | -# Update #: 377 |
| 9 | +# Last-Updated: Thu Aug 11 11:29:36 2016 (-0400) |
| 10 | +# By: Subhasis Ray |
| 11 | +# Update #: 389 |
12 | 12 | # URL: |
13 | 13 | # Keywords: |
14 | 14 | # Compatibility: |
@@ -76,8 +76,8 @@ def cell_to_graph(cell, label=False): |
76 | 76 | msg = 'distalOut' |
77 | 77 | else: |
78 | 78 | raise Exception('No neighbors on raxial or distal') |
79 | | - es = [(c1.path, c2[0].path, {'weight': 2/ (moose.Compartment(c1).Ra + moose.Compartment(c2).Ra)}) \ |
80 | | - for c1 in moose.wildcardFind('%s/##[ISA=Compartment]' % (cell.path)) \ |
| 79 | + es = [(c1.path, c2[0].path, {'weight': 2/ (c1.Ra + c2[0].Ra)}) \ |
| 80 | + for c1 in moose.wildcardFind('%s/##[ISA=CompartmentBase]' % (cell.path)) \ |
81 | 81 | for c2 in moose.Compartment(c1).neighbors[msg]] |
82 | 82 | g = nx.Graph() |
83 | 83 | g.add_edges_from(es) |
@@ -109,7 +109,7 @@ def plot_cell_topology(cell, label=False): |
109 | 109 | weights = np.array([g.edge[e[0]][e[1]]['weight'] for e in g.edges()]) |
110 | 110 | try: |
111 | 111 | pos = nx.graphviz_layout(g,prog='twopi',root=cell.path + '/comp_1') |
112 | | - except NameError, AttributeError: |
| 112 | + except (NameError, AttributeError) as e: |
113 | 113 | # this is the best networkx can do by itself. Its Furchtman |
114 | 114 | # Reingold layout ends up with overlapping edges even for a |
115 | 115 | # tree. igraph does much better. |
@@ -151,7 +151,6 @@ def plot_cell_topology(cell, label=False): |
151 | 151 | print('-p filename (optional) save outputin a pdf file named "filename".') |
152 | 152 | print('-h,--help print this help') |
153 | 153 | sys.exit(0) |
154 | | - print( 'args', optlist, args) |
155 | 154 | figures = [] |
156 | 155 | if len(celltype) > 0: |
157 | 156 | try: |
|
0 commit comments