Skip to content

Commit 31ee50d

Browse files
author
mb3152
committed
nodal roles docs cleaned up
1 parent bef5fbf commit 31ee50d

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

brainx/nodal_roles.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,22 @@ def within_community_degree(weighted_partition, nan = 0.0, catch_edgeless_node=T
1010
------
1111
Parameters
1212
------
13-
weighted_partition = Louvain Weighted Partition
14-
nan = number to replace unexpected values (e.g., -infinity) with
15-
catch_edgeless_node = raise ValueError if node degree is zero
13+
weighted_partition: Louvain Weighted Partition
14+
louvain = weighted_modularity.wm.LouvainCommunityDetection()
15+
weighted_partitions = louvain.run()
16+
weighted_partition = weighted_partition[0], where index is the partition level
17+
nan : int
18+
number to replace unexpected values (e.g., -infinity) with
19+
default = 0.0
20+
catch_edgeless_node: Boolean
21+
raise ValueError if node degree is zero
22+
default = True
1623
1724
------
1825
Returns
1926
------
20-
Dictionary of the within community degree of each node.
27+
within_community_degree: dict
28+
Dictionary of the within community degree of each node.
2129
2230
'''
2331
wc_dict = {}
@@ -48,14 +56,19 @@ def participation_coefficient(weighted_partition, catch_edgeless_node=True):
4856
------
4957
Parameters
5058
------
51-
weighted_partition = Louvain Weighted Partition
52-
catch_edgeless_node = raise ValueError if node degree is zero
59+
weighted_partition: Louvain Weighted Partition
60+
louvain = weighted_modularity.wm.LouvainCommunityDetection()
61+
weighted_partitions = louvain.run()
62+
weighted_partition = weighted_partition[0], where index is the partition level
63+
catch_edgeless_node: Boolean
64+
raise ValueError if node degree is zero
65+
default = True
5366
5467
------
5568
Returns
5669
------
57-
Dictionary of the participation coefficient for each node.
58-
70+
participation_coefficient: dict
71+
Dictionary of the participation coefficient of each node.
5972
'''
6073
pc_dict = {}
6174
graph = weighted_partition.graph

0 commit comments

Comments
 (0)