Skip to content

Commit 38ddbd0

Browse files
committed
rearrange imports names to avoid collisions
1 parent 654059c commit 38ddbd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyvipr/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import networkx as nx
55
import networkx.algorithms.community as nx_community
6-
from community import best_partition, generate_dendrogram
6+
from community import community_louvain
77

88

99
class MidpointNormalize(colors.Normalize):
@@ -81,7 +81,7 @@ def add_louvain_communities(graph, all_levels=False, random_state=None):
8181
if all_levels:
8282
# We add the first communities detected, The dendrogram at level 0 contains the nodes as keys
8383
# and the clusters they belong to as values.
84-
dendrogram = generate_dendrogram(graph_communities, random_state=random_state)
84+
dendrogram = community_louvain.generate_dendrogram(graph_communities, random_state=random_state)
8585
partition = dendrogram[0]
8686
cnodes = set(partition.values())
8787
graph.add_nodes_from(cnodes, NodeType='subcommunity')
@@ -108,7 +108,7 @@ def add_louvain_communities(graph, all_levels=False, random_state=None):
108108
nx.set_node_attributes(graph, cluster_child_parent2, 'parent')
109109
# Update nodes clusters
110110
else:
111-
communities = best_partition(graph_communities, random_state=random_state)
111+
communities = community_louvain.best_partition(graph_communities, random_state=random_state)
112112
# compound nodes to add to hold communities
113113
cnodes = set(communities.values())
114114
graph.add_nodes_from(cnodes, NodeType='community')

0 commit comments

Comments
 (0)