From caba3041d170311c801ed84d63fa975aa265ac84 Mon Sep 17 00:00:00 2001 From: Vighnesh Birodkar Date: Wed, 6 May 2015 00:55:04 +0530 Subject: [PATCH] indentation correction --- doc/examples/plot_rag_boundary.py | 2 +- skimage/future/graph/rag.py | 7 +++---- skimage/future/graph/tests/test_rag.py | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/examples/plot_rag_boundary.py b/doc/examples/plot_rag_boundary.py index 5324a2bd..fb2e51a5 100644 --- a/doc/examples/plot_rag_boundary.py +++ b/doc/examples/plot_rag_boundary.py @@ -8,7 +8,7 @@ This example demonstrates construction of region boundary based RAGs with the """ from skimage.future import graph from skimage import data, segmentation, color, filters, io -from matplotlib import pyplot as plt, colors +from matplotlib import pyplot as colors img = data.coffee() gimg = color.rgb2gray(img) diff --git a/skimage/future/graph/rag.py b/skimage/future/graph/rag.py index 6c8fa502..ab6d2fc7 100644 --- a/skimage/future/graph/rag.py +++ b/skimage/future/graph/rag.py @@ -349,8 +349,7 @@ def rag_boundary(labels, edge_map, connectivity=2): nbr_indices = list(np.ndindex(*[2]*labels.ndim)) del nbr_indices[0] nbr_indices_arr = ([idx for idx in nbr_indices if np.linalg.norm(idx) - <= connectivity]) - + <= connectivity]) iter_shape = tuple(np.array(labels.shape) - 1) @@ -358,14 +357,14 @@ def rag_boundary(labels, edge_map, connectivity=2): index_arr = np.array(index) current = labels[index] - graph.add_node(current, {'labels':[current]}) + graph.add_node(current, {'labels': [current]}) for nbr_index in nbr_indices_arr: adjacent_idx = tuple(index_arr + nbr_index) adjacent = labels[adjacent_idx] - if current==adjacent: + if current == adjacent: continue if graph.has_edge(current, adjacent): diff --git a/skimage/future/graph/tests/test_rag.py b/skimage/future/graph/tests/test_rag.py index 8f1df909..4af3d854 100644 --- a/skimage/future/graph/tests/test_rag.py +++ b/skimage/future/graph/tests/test_rag.py @@ -202,8 +202,8 @@ def test_rag_boundary(): labels = np.zeros((16, 16), dtype='uint8') edge_map = np.zeros_like(labels, dtype=float) - edge_map[8,:] = 0.5 - edge_map[:,8] = 1.0 + edge_map[8, :] = 0.5 + edge_map[:, 8] = 1.0 labels[:8, :8] = 1 labels[:8, 8:] = 2