Skip to content

Commit

Permalink
Merge pull request #1936 from ahojnnes/depr
Browse files Browse the repository at this point in the history
Fix some remaining TODO items
  • Loading branch information
jni committed Feb 9, 2016
2 parents 66102ad + 116ef0d commit a6e0761
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 56 deletions.
9 changes: 0 additions & 9 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,5 @@ Version 0.12
------------
* Change `label` to mark background as 0, not -1, which is consistent with
SciPy's labelling.
* Remove deprecated `reverse_map` parameter of `skimage.transform.warp`
* Change deprecated `enforce_connectivity=False` on skimage.segmentation.slic
and set it to True as default
* Remove deprecated `skimage.measure.fit.BaseModel._params` attribute
* Remove deprecated `skimage.measure.fit.BaseModel._params`,
`skimage.transform.ProjectiveTransform._matrix`,
`skimage.transform.PolynomialTransform._params`,
`skimage.transform.PiecewiseAffineTransform.affines_*` attributes
* Remove deprecated functions `skimage.filters.denoise_*`
* Add 3D phantom in `skimage.data`
* Add 3D test case of `skimage.feature.phase_correlate`
8 changes: 8 additions & 0 deletions doc/source/api_changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Version 0.12
the ``ntiles_*`` arguments.
- The functions ``blob_dog``, ``blob_log`` and ``blob_doh`` now return float
arrays instead of integer arrays.
- `reverse_map` parameter in `skimage.transform.warp` has been removed.
- `enforce_connectivity` in `skimage.segmentation.slic` defaults to ``True``.
- `skimage.measure.fit.BaseModel._params`,
`skimage.transform.ProjectiveTransform._matrix`,
`skimage.transform.PolynomialTransform._params`,
`skimage.transform.PiecewiseAffineTransform.affines_*` attributes
have been removed.
- `skimage.filters.denoise_*` have moved to `skimage.restoration.denoise_*`.

Version 0.11
------------
Expand Down
7 changes: 1 addition & 6 deletions skimage/filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@

from .._shared.utils import deprecated, copy_func
from .. import restoration
denoise_bilateral = deprecated('skimage.restoration.denoise_bilateral')\
(restoration.denoise_bilateral)
denoise_tv_bregman = deprecated('skimage.restoration.denoise_tv_bregman')\
(restoration.denoise_tv_bregman)
denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
(restoration.denoise_tv_chambolle)

gaussian_filter = copy_func(gaussian, name='gaussian_filter')
gaussian_filter = deprecated('skimage.filters.gaussian')(gaussian_filter)
gabor_filter = copy_func(gabor, name='gabor_filter')
Expand Down
5 changes: 0 additions & 5 deletions skimage/measure/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class BaseModel(object):
def __init__(self):
self.params = None

@property
def _params(self):
warn('`_params` attribute is deprecated, use `params` instead.')
return self.params


class LineModel(BaseModel):

Expand Down
9 changes: 0 additions & 9 deletions skimage/measure/tests/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,5 @@ def test_ransac_invalid_input():
residual_threshold=0, stop_probability=1.01)


def test_deprecated_params_attribute():
model = LineModelND()
model.params = ((0, 0), (1, 1))
x = np.arange(-10, 10)
y = model.predict_y(x)
with expected_warnings(['`_params`']):
assert_equal(model.params, model._params)


if __name__ == "__main__":
np.testing.run_module_suite()
8 changes: 2 additions & 6 deletions skimage/segmentation/slic_superpixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
spacing=None, multichannel=True, convert2lab=None,
enforce_connectivity=False, min_size_factor=0.5, max_size_factor=3,
enforce_connectivity=True, min_size_factor=0.5, max_size_factor=3,
slic_zero=False):
"""Segments image using k-means clustering in Color-(x,y,z) space.
Expand Down Expand Up @@ -53,7 +53,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
segmentation. The input image *must* be RGB. Highly recommended.
This option defaults to ``True`` when ``multichannel=True`` *and*
``image.shape[-1] == 3``.
enforce_connectivity: bool, optional (default False)
enforce_connectivity: bool, optional
Whether the generated segments are connected or not
min_size_factor: float, optional
Proportion of the minimum segment size to be removed with respect
Expand Down Expand Up @@ -110,10 +110,6 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
>>> segments = slic(img, n_segments=100, compactness=20)
"""
if enforce_connectivity is None:
warn('Deprecation: enforce_connectivity will default to'
' True in future versions.')
enforce_connectivity = False

image = img_as_float(image)
is_2d = False
Expand Down
10 changes: 0 additions & 10 deletions skimage/transform/_geometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ def __init__(self, matrix=None):
raise ValueError("invalid shape of transformation matrix")
self.params = matrix

@property
def _matrix(self):
warn('`_matrix` attribute is deprecated, use `params` instead.')
return self.params

@property
def _inv_matrix(self):
return np.linalg.inv(self.params)
Expand Down Expand Up @@ -778,11 +773,6 @@ def __init__(self, params=None):
raise ValueError("invalid shape of transformation parameters")
self.params = params

@property
def _params(self):
warn('`_params` attribute is deprecated, use `params` instead.')
return self.params

def estimate(self, src, dst, order=2):
"""Set the transformation matrix with the explicit transformation
parameters.
Expand Down
11 changes: 0 additions & 11 deletions skimage/transform/tests/test_geometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,6 @@ def test_invalid_input():
assert_raises(ValueError, PolynomialTransform, np.zeros((3, 3)))


def test_deprecated_params_attributes():
for t in ('projective', 'affine', 'similarity'):
tform = estimate_transform(t, SRC, DST)
with expected_warnings(['`_matrix`.*deprecated']):
assert_equal(tform._matrix, tform.params)

tform = estimate_transform('polynomial', SRC, DST, order=3)
with expected_warnings(['`_params`.*deprecated']):
assert_equal(tform._params, tform.params)


def test_degenerate():
src = dst = np.zeros((10, 2))

Expand Down

0 comments on commit a6e0761

Please sign in to comment.