mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-23 13:10:18 +08:00
Changed max_edge in example/plot_rag.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user