Skip to content

Commit 97ff555

Browse files
author
mb3152
committed
cleaned up nodal_roles
1 parent c7802ba commit 97ff555

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

brainx/nodal_roles.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ def within_community_degree(weighted_partition):
2525
node_community = weighted_partition.get_node_community(node)
2626
within_community_degree = weighted_partition.degree_within_community(node)
2727
try: # to load average within module degree of community
28-
all_community_degree = all_community_degrees[node_community]
28+
community_degrees = all_community_degrees[node_community]
2929
except: # collect within module degree of community
30-
all_community_degree = []
30+
community_degrees = []
3131
for node in node_community:
3232
partition.degree_within_community(node)
3333
all_community_degree.append()
34-
all_community_degrees[node_community] = all_community_degree
34+
all_community_degrees[node_community] = community_degrees
3535
# I don't know if it's faster to compute this on the fly every
3636
# time or store the results in a dictionary?
37-
std = np.std(all_community_degree) # std of community's degrees
38-
mean = np.mean(all_community_degree) # mean of community's degrees
37+
std = np.std(community_degrees) # std of community's degrees
38+
mean = np.mean(community_degrees) # mean of community's degrees
3939
# z-score
4040
wc_dict[node] = (within_community_degree - mean / std)
4141
return wc_dict

0 commit comments

Comments
 (0)