Skip to content

Commit

Permalink
⬆️ minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Mar 8, 2022
1 parent b473564 commit a27873b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cdlib/test/test_community_discovery_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ def test_markov_clustering(self):
self.assertEqual(type(communities.communities[0][0]), int)

def test_bigClam(self):
if karateclub is None:
return
g = nx.karate_club_graph()
coms = algorithms.big_clam(g)
self.assertEqual(type(coms.communities), list)
Expand Down Expand Up @@ -478,6 +480,8 @@ def test_sbm_nested_dl(self):
self.assertEqual(type(coms.communities[0][0]), str)

def test_danmf(self):
if karateclub is None:
return
g = get_string_graph()
coms = algorithms.danmf(g)
self.assertEqual(type(coms.communities), list)
Expand All @@ -486,6 +490,8 @@ def test_danmf(self):
self.assertEqual(type(coms.communities[0][0]), str)

def test_egonet_splitter(self):
if karateclub is None:
return
g = get_string_graph()
coms = algorithms.egonet_splitter(g)
self.assertEqual(type(coms.communities), list)
Expand All @@ -494,6 +500,8 @@ def test_egonet_splitter(self):
self.assertEqual(type(coms.communities[0][0]), str)

def test_nnsed(self):
if karateclub is None:
return
g = nx.karate_club_graph()
coms = algorithms.nnsed(g)
self.assertEqual(type(coms.communities), list)
Expand All @@ -502,6 +510,8 @@ def test_nnsed(self):
self.assertEqual(type(coms.communities[0][0]), int)

def test_mnmf(self):
if karateclub is None:
return
g = nx.karate_club_graph()
coms = algorithms.mnmf(g)
self.assertEqual(type(coms.communities), list)
Expand All @@ -510,6 +520,8 @@ def test_mnmf(self):
self.assertEqual(type(coms.communities[0][0]), int)

def test_edmot(self):
if karateclub is None:
return
g = nx.karate_club_graph()
coms = algorithms.edmot(g)
self.assertEqual(type(coms.communities), list)
Expand Down Expand Up @@ -625,7 +637,8 @@ def test_CPM_Bipartite(self):
g = ig.Graph.Erdos_Renyi(n=80, m=600)
g.vs["type"] = 0
g.vs[15:]["type"] = 1

if leidenalg is None:
return
coms = algorithms.CPM_Bipartite(g, 0.3)
self.assertEqual(type(coms.communities), list)
if len(coms.communities) > 0:
Expand All @@ -640,6 +653,8 @@ def test_CPM_Bipartite(self):
self.assertEqual(type(coms.communities[0][0]), int)

def test_infomap_Bipartite(self):
if infomap is None:
return
g = nx.algorithms.bipartite.random_graph(300, 100, 0.2)
coms = algorithms.infomap_bipartite(g)
self.assertEqual(type(coms.communities), list)
Expand Down Expand Up @@ -788,6 +803,8 @@ def test_kcut(self):
print("Kcut error to be checked (conda packaging)")

def test_symmnmf(self):
if karateclub is None:
return
G = nx.karate_club_graph()

coms = algorithms.symmnmf(G)
Expand All @@ -806,6 +823,8 @@ def test_scd(self):
self.assertEqual(type(coms.communities[0][0]), int)

def test_gemsec(self):
if karateclub is None:
return
G = nx.karate_club_graph()

coms = algorithms.gemsec(G)
Expand Down

0 comments on commit a27873b

Please sign in to comment.