From 58cc399e8375af382a30b671c22c16c7b2b089a4 Mon Sep 17 00:00:00 2001 From: Vighnesh Birodkar Date: Sun, 14 Dec 2014 06:33:21 +0530 Subject: [PATCH] rename mapping array --- skimage/graph/graph_merge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skimage/graph/graph_merge.py b/skimage/graph/graph_merge.py index 5d918e29..88b8d9ab 100644 --- a/skimage/graph/graph_merge.py +++ b/skimage/graph/graph_merge.py @@ -27,7 +27,7 @@ def _revalidate_node_edges(rag, node, heap_list): # invalidate existing neghbors of `dst`, they have new weights data['heap item'][3] = False except KeyError: - # will hangle the case where the edge did not exist in the existing + # will handle the case where the edge did not exist in the existing # graph pass @@ -123,9 +123,9 @@ def merge_hierarchical(labels, rag, thresh, rag_copy, in_place_merge, new_id = rag.merge_nodes(src, dst, weight_func) _revalidate_node_edges(rag, new_id, edge_heap) - arr = np.arange(labels.max() + 1) + label_map = np.arange(labels.max() + 1) for ix, (n, d) in enumerate(rag.nodes_iter(data=True)): for label in d['labels']: - arr[label] = ix + label_map[label] = ix - return arr[labels] + return label_map[labels]