Skip to content

Commit 371517f

Browse files
author
CindeeM
committed
RF: remove unused Guimera modularity code
1 parent a9fd05a commit 371517f

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

brainx/modularity.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -154,42 +154,9 @@ def modularity_newman(self):
154154
1/0
155155
return (np.array(self.mod_e) - (np.array(self.mod_a)**2)).sum()
156156

157+
##TODO can we remove this?? CM
157158
modularity = modularity_newman
158159

159-
#modularity = modularity_guimera
160-
161-
162-
## def modularity_guimera(self, g, part):
163-
## """This function takes in a graph and a partition and returns Newman's
164-
## modularity for that graph"""
165-
166-
## """ Parameters
167-
## # g = graph part = partition; a dictionary that contains a list of
168-
## # nodes that make up that module"""
169-
170-
## #graph values
171-
## num_mod = len(part)
172-
## L = nx.number_of_edges(g)
173-
## # construct an adjacency matrix from the input graph (g)
174-
## mat = nx.adj_matrix(g)
175-
176-
## M = 0
177-
## # loop over the modules in the graph, create an adjacency matrix
178-
## for m, val in part.iteritems():
179-
## #create a 'sub mat'
180-
## submat = mat[val,:][:,val]
181-
182-
## #make a graph
183-
## subg = nx.from_numpy_matrix(submat)
184-
185-
## #calculate module-specific metrics
186-
## link_s = float(subg.number_of_edges())
187-
## deg_s = np.sum(nx.degree(g,val), dtype=float)
188-
189-
## #compute modularity!
190-
## M += ((link_s/L) - (deg_s/(2*L))**2)
191-
192-
## return M
193160

194161
def compute_module_merge(self, m1, m2):
195162
"""Merges two modules in a given partition.

0 commit comments

Comments
 (0)