File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,9 @@ def test_degree_by_community(self):
120
120
part_2comm = wm .WeightedPartition (self .graph , self .communities )
121
121
self .assertEqual (part_2comm == degw , False )
122
122
123
- def test_internal_links (self ):
123
+ def test_degree_within_community (self ):
124
124
part = wm .WeightedPartition (self .graph ) # one comm per node
125
- weights = part .internal_links ()
125
+ weights = part .degree_within_community ()
126
126
## this inlcudes self links so
127
127
self .assertEqual (weights [0 ], 1.0 )
128
128
Original file line number Diff line number Diff line change @@ -131,9 +131,9 @@ def degree_by_community(self):
131
131
weights [node_comm ] += weight
132
132
return weights
133
133
134
- def internal_links (self ):
135
- """ sum of weighted links strictly inside each community
136
- includes self loops"""
134
+ def degree_within_community (self ):
135
+ """ sum of weighted edges strictly inside each community
136
+ including self loops"""
137
137
comm = self .communities
138
138
weights = [0 ] * len (comm )
139
139
comm = self .communities
@@ -176,7 +176,7 @@ def modularity(self):
176
176
raise TypeError ('only valid on non directed graphs' )
177
177
178
178
m2 = self .total_edge_weight
179
- internal_connect = np .array (self .internal_links ())
179
+ internal_connect = np .array (self .degree_within_community ())
180
180
total = np .array (self .degree_by_community ())
181
181
return np .sum (internal_connect / m2 - (total / (2 * m2 ))** 2 )
182
182
You can’t perform that action at this time.
0 commit comments