Changed max_edge in example/plot_rag.py

This commit is contained in:
Vighnesh Birodkar committed 2014-06-28 11:06:30 +05:30
1 parent f71ad51f57
commit dd67b3fce7
3 files changed
+11 -19

No files matched your search

+4
View File
@@ -23,10 +23,14 @@ def test_rag_merge():
gc = g.copy()
# We merge nodes and ensure that the minimum weight is chosen
# when there is a conflict.
g.merge_nodes(0, 2)
assert g.edge[1][2]['weight'] == 10
assert g.edge[2][3]['weight'] == 30
# We specify `max_edge` as `weight_func` as ensure that maximum
# weight is chosen in case on conflict
gc.merge_nodes(0, 2, weight_func=max_edge)
assert gc.edge[1][2]['weight'] == 20
assert gc.edge[2][3]['weight'] == 40