Skip to content

Commit 8d356a9

Browse files
committed
test: fix deprecation warnings in unit tests
1 parent 941f43a commit 8d356a9

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

src/_igraph/convert.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ int igraphmodule_PyObject_to_attribute_combination_type_t(PyObject* o,
266266
static igraphmodule_enum_translation_table_entry_t attribute_combination_type_tt[] = {
267267
{"ignore", IGRAPH_ATTRIBUTE_COMBINE_IGNORE},
268268
{"sum", IGRAPH_ATTRIBUTE_COMBINE_SUM},
269+
{"prod", IGRAPH_ATTRIBUTE_COMBINE_PROD},
269270
{"product", IGRAPH_ATTRIBUTE_COMBINE_PROD},
270271
{"min", IGRAPH_ATTRIBUTE_COMBINE_MIN},
271272
{"max", IGRAPH_ATTRIBUTE_COMBINE_MAX},
@@ -274,6 +275,7 @@ int igraphmodule_PyObject_to_attribute_combination_type_t(PyObject* o,
274275
{"last", IGRAPH_ATTRIBUTE_COMBINE_LAST},
275276
{"mean", IGRAPH_ATTRIBUTE_COMBINE_MEAN},
276277
{"median", IGRAPH_ATTRIBUTE_COMBINE_MEDIAN},
278+
{"concat", IGRAPH_ATTRIBUTE_COMBINE_CONCAT},
277279
{"concatenate", IGRAPH_ATTRIBUTE_COMBINE_CONCAT},
278280
{0, 0}
279281
};
@@ -483,6 +485,7 @@ int igraphmodule_PyObject_to_community_comparison_t(PyObject *o,
483485
{"nmi", IGRAPH_COMMCMP_NMI},
484486
{"danon", IGRAPH_COMMCMP_NMI},
485487
{"split-join", IGRAPH_COMMCMP_SPLIT_JOIN},
488+
{"split_join", IGRAPH_COMMCMP_SPLIT_JOIN},
486489
{"rand", IGRAPH_COMMCMP_RAND},
487490
{"adjusted_rand", IGRAPH_COMMCMP_ADJUSTED_RAND},
488491
{0,0}

src/igraph/clustering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def cluster_graph(self, combine_vertices=None, combine_edges=None):
352352
"""
353353
result = self.graph.copy()
354354
result.contract_vertices(self.membership, combine_vertices)
355-
if combine_edges != False:
355+
if combine_edges is not False:
356356
result.simplify(combine_edges=combine_edges)
357357
return result
358358

tests/test_conversion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def testToDirectedAcyclic(self):
6464
graph.to_directed("acyclic")
6565
self.assertTrue(graph.is_directed())
6666
self.assertTrue(graph.vcount() == 5)
67-
print(graph.get_edgelist())
6867
self.assertTrue(
6968
sorted(graph.get_edgelist())
7069
== [(0, 1), (0, 2), (0, 3), (0, 3), (2, 4)]

tests/test_decomposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def testCompareNMI(self):
583583

584584
def testCompareSplitJoin(self):
585585
expected = [0, 3, 5, 11]
586-
self._testMethod("split", expected)
586+
self._testMethod("split_join", expected)
587587
l1 = [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3]
588588
l2 = [3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 4, 2]
589589
self.assertEqual(split_join_distance(l1, l2), (6, 5))

tests/test_structural.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def testHubScore(self):
434434

435435
def testCoreness(self):
436436
g = Graph.Full(4) + Graph(4) + [(0, 4), (1, 5), (2, 6), (3, 7)]
437-
self.assertEqual(g.coreness("A"), [3, 3, 3, 3, 1, 1, 1, 1])
437+
self.assertEqual(g.coreness("all"), [3, 3, 3, 3, 1, 1, 1, 1])
438438

439439

440440
class NeighborhoodTests(unittest.TestCase):

0 commit comments

Comments
 (0)