Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
François Boulogne committed Oct 14, 2013
1 parent 5a0878d commit eb4c5c9
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 19 deletions.
1 change: 0 additions & 1 deletion doc/examples/plot_join_segmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@
ax.axis('off')
plt.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, right=1)
plt.show()

1 change: 0 additions & 1 deletion doc/examples/plot_marching_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection

from skimage import measure
Expand Down
1 change: 1 addition & 0 deletions skimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def _test(verbose=False):
class _Log(Warning):
pass


class _FakeLog(object):
def __init__(self, name):
"""
Expand Down
1 change: 0 additions & 1 deletion skimage/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,3 @@ def coffee():
"""
return load("coffee.png")

2 changes: 1 addition & 1 deletion skimage/exposure/exposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def adjust_log(image, gain=1, inv=False):
inv : float
If True, it performs inverse logarithmic correction,
else correction will be logarithmic. Defaults to False.
Returns
-------
out : ndarray
Expand Down
2 changes: 1 addition & 1 deletion skimage/filter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ._gaussian import gaussian_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
hprewitt, vprewitt, roberts, roberts_positive_diagonal,
roberts_negative_diagonal)
from ._denoise import denoise_tv_chambolle, tv_denoise
from ._denoise_cy import denoise_bilateral, denoise_tv_bregman
Expand Down
2 changes: 1 addition & 1 deletion skimage/filter/_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def denoise_tv_chambolle(im, weight=50, eps=2.e-4, n_iter_max=200,
out = np.zeros_like(im)
for c in range(im.shape[2]):
out[..., c] = _denoise_tv_chambolle_2d(im[..., c], weight, eps,
n_iter_max)
n_iter_max)
else:
out = _denoise_tv_chambolle_3d(im, weight, eps, n_iter_max)
else:
Expand Down
12 changes: 6 additions & 6 deletions skimage/filter/_rank_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
All rights reserved.
Original author: Lee Kamentstky
"""
import numpy
import numpy as np


def rank_order(image):
Expand Down Expand Up @@ -47,14 +47,14 @@ def rank_order(image):
(array([0, 1, 2, 1], dtype=uint32), array([-1. , 2.5, 3.1]))
"""
flat_image = image.ravel()
sort_order = flat_image.argsort().astype(numpy.uint32)
sort_order = flat_image.argsort().astype(np.uint32)
flat_image = flat_image[sort_order]
sort_rank = numpy.zeros_like(sort_order)
sort_rank = np.zeros_like(sort_order)
is_different = flat_image[:-1] != flat_image[1:]
numpy.cumsum(is_different, out=sort_rank[1:])
original_values = numpy.zeros((sort_rank[-1] + 1,), image.dtype)
np.cumsum(is_different, out=sort_rank[1:])
original_values = np.zeros((sort_rank[-1] + 1,), image.dtype)
original_values[0] = flat_image[0]
original_values[1:] = flat_image[1:][is_different]
int_image = numpy.zeros_like(sort_order)
int_image = np.zeros_like(sort_order)
int_image[sort_order] = sort_rank
return (int_image.reshape(image.shape), original_values)
6 changes: 3 additions & 3 deletions skimage/filter/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
[-1,-1,-1]]) / 3.0
VPREWITT_WEIGHTS = HPREWITT_WEIGHTS.T

ROBERTS_PD_WEIGHTS = np.array([[ 1, 0],
[ 0, -1]], dtype=np.double)
ROBERTS_PD_WEIGHTS = np.array([[1, 0],
[0, -1]], dtype=np.double)
ROBERTS_ND_WEIGHTS = np.array([[0, 1],
[-1, 0]], dtype=np.double)

Expand Down Expand Up @@ -346,7 +346,7 @@ def roberts(image, mask=None):
"""Find the edge magnitude using Roberts' cross operator.
Parameters
----------
----------
image : 2-D array
Image to process.
mask : 2-D array, optional
Expand Down
2 changes: 1 addition & 1 deletion skimage/morphology/convex_hull.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def convex_hull_image(image):
(-0.5, 0.5, 0, 0))):
coords_corners[i * N:(i + 1) * N] = coords + [x_offset, y_offset]

# repeated coordinates can *sometimes* cause problems in
# repeated coordinates can *sometimes* cause problems in
# scipy.spatial.Delaunay, so we remove them.
coords = unique_rows(coords_corners)

Expand Down
5 changes: 2 additions & 3 deletions skimage/segmentation/_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def relabel_sequential(label_field, offset=1):
Examples
--------
>>> from skimage.segmentation import relabel_sequential
>>> label_field = array([1, 1, 5, 5, 8, 99, 42])
>>> label_field = np.array([1, 1, 5, 5, 8, 99, 42])
>>> relab, fw, inv = relabel_sequential(label_field)
>>> relab
array([1, 1, 2, 2, 3, 5, 4])
Expand All @@ -117,7 +117,7 @@ def relabel_sequential(label_field, offset=1):
labels = np.unique(label_field)
labels0 = labels[labels != 0]
m = labels.max()
if m == len(labels0): # nothing to do, already 1...n labels
if m == len(labels0): # nothing to do, already 1...n labels
return label_field, labels, labels
forward_map = np.zeros(m+1, int)
forward_map[labels0] = np.arange(offset, offset + len(labels0) + 1)
Expand All @@ -127,4 +127,3 @@ def relabel_sequential(label_field, offset=1):
inverse_map[(offset - 1):] = labels
relabeled = forward_map[label_field]
return relabeled, forward_map, inverse_map

1 change: 1 addition & 0 deletions viewer_examples/plugins/watershed_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from skimage.viewer.widgets import history
from skimage.viewer.plugins.labelplugin import LabelPainter


class OKCancelButtons(history.OKCancelButtons):

def update_original_image(self):
Expand Down

0 comments on commit eb4c5c9

Please sign in to comment.