def test_surprise(self): g = get_string_graph() coms = algorithms.surprise_communities(g) self.assertEqual(type(coms.communities), list) if len(coms.communities) > 0: self.assertEqual(type(coms.communities[0]), list) self.assertEqual(type(coms.communities[0][0]), str)
#elif(options.method == 'infomap'): # communities = algorithms.infomap(g) elif (options.method == 'label_propagation'): communities = algorithms.label_propagation(g, **clust_kwargs) elif (options.method == 'markov_clustering'): communities = algorithms.markov_clustering(g, **clust_kwargs) elif (options.method == 'rber_pots'): communities = algorithms.rber_pots(g, weights='weight', **clust_kwargs) elif (options.method == 'rb_pots'): communities = algorithms.rb_pots(g, weights='weight', **clust_kwargs) elif (options.method == 'significance_communities'): communities = algorithms.significance_communities(g, **clust_kwargs) elif (options.method == 'spinglass'): communities = algorithms.spinglass(g, **clust_kwargs) elif (options.method == 'surprise_communities'): communities = algorithms.surprise_communities(g, **clust_kwargs) elif (options.method == 'walktrap'): communities = algorithms.walktrap(g, **clust_kwargs) #elif(options.method == 'sbm_dl'): # communities = algorithms.sbm_dl(g) #elif(options.method == 'sbm_dl_nested'): # communities = algorithms.sbm_dl_nested(g) elif (options.method == 'lais2'): communities = algorithms.lais2(g, **clust_kwargs) elif (options.method == 'big_clam'): communities = algorithms.big_clam(g, **clust_kwargs) elif (options.method == 'danmf'): communities = algorithms.danmf(g, **clust_kwargs) elif (options.method == 'ego_networks'): communities = algorithms.ego_networks(g, **clust_kwargs) elif (options.method == 'egonet_splitter'):