mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-09 15:20:38 +08:00
Merge pull request #2156 from soupault/depr_013
Remove deprecated `_mode_deprecations`
This commit is contained in:
@@ -22,7 +22,3 @@ Version 0.14
|
||||
Version 0.13
|
||||
------------
|
||||
* Remove deprecated `None` defaults for `skimage.exposure.rescale_intensity`
|
||||
* Remove supported for renamed edge mode, 'nearest' (it is now 'edge'). This
|
||||
involves removing the function _mode_deprecations from skimage._shared.utils
|
||||
as well as any uses of _mode_deprecations from restoration/_denoise.py,
|
||||
_shared/interpolation.pyx, transform/_geometric.py, and transform/_warps.py
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from interpolation cimport coord_map, get_pixel2d
|
||||
import numpy as np
|
||||
cimport numpy as cnp
|
||||
from .utils import _mode_deprecations
|
||||
|
||||
|
||||
def coord_map_py(Py_ssize_t dim, long coord, mode):
|
||||
@@ -37,7 +36,7 @@ def extend_image(image, pad=10, mode='constant', cval=0):
|
||||
function is intended only for testing `get_pixel2d` and demonstrating the
|
||||
coordinate mapping modes implemented in `coord_map`.
|
||||
"""
|
||||
mode = _mode_deprecations(mode)
|
||||
|
||||
cdef:
|
||||
Py_ssize_t rows = image.shape[0]
|
||||
Py_ssize_t cols = image.shape[1]
|
||||
|
||||
@@ -167,17 +167,6 @@ def assert_nD(array, ndim, arg_name='image'):
|
||||
raise ValueError(msg % (arg_name, '-or-'.join([str(n) for n in ndim])))
|
||||
|
||||
|
||||
def _mode_deprecations(mode):
|
||||
"""Used to update deprecated mode names in
|
||||
`skimage._shared.interpolation.pyx`."""
|
||||
if mode.lower() == 'nearest':
|
||||
warn(skimage_deprecation(
|
||||
"Mode 'nearest' has been renamed to 'edge'. Mode 'nearest' will be "
|
||||
"removed in a future release."))
|
||||
mode = 'edge'
|
||||
return mode
|
||||
|
||||
|
||||
def copy_func(f, name=None):
|
||||
"""Create a copy of a function.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import numpy as np
|
||||
from math import ceil
|
||||
from .. import img_as_float
|
||||
from ..restoration._denoise_cy import _denoise_bilateral, _denoise_tv_bregman
|
||||
from .._shared.utils import _mode_deprecations, skimage_deprecation, warn
|
||||
from .._shared.utils import skimage_deprecation, warn
|
||||
import warnings
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ def denoise_bilateral(image, win_size=None, sigma_color=None, sigma_spatial=1,
|
||||
if win_size is None:
|
||||
win_size = max(5, 2 * int(ceil(3 * sigma_spatial)) + 1)
|
||||
|
||||
mode = _mode_deprecations(mode)
|
||||
return _denoise_bilateral(image, win_size, sigma_color, sigma_spatial,
|
||||
bins, mode, cval)
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import numpy as np
|
||||
from scipy import spatial
|
||||
from scipy import ndimage as ndi
|
||||
|
||||
from .._shared.utils import (get_bound_method_class, safe_as_int,
|
||||
_mode_deprecations, warn)
|
||||
from .._shared.utils import (get_bound_method_class, safe_as_int, warn)
|
||||
from ..util import img_as_float
|
||||
|
||||
from ._warps_cy import _warp_fast
|
||||
@@ -13,7 +12,6 @@ from ._warps_cy import _warp_fast
|
||||
|
||||
def _to_ndimage_mode(mode):
|
||||
"""Convert from `numpy.pad` mode name to the corresponding ndimage mode."""
|
||||
mode = _mode_deprecations(mode.lower())
|
||||
mode_translation_dict = dict(edge='nearest', symmetric='reflect',
|
||||
reflect='mirror')
|
||||
if mode in mode_translation_dict:
|
||||
@@ -1286,7 +1284,6 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
|
||||
>>> warped = warp(cube, coords)
|
||||
|
||||
"""
|
||||
mode = _mode_deprecations(mode)
|
||||
image = _convert_warp_input(image, preserve_range)
|
||||
|
||||
input_shape = np.array(image.shape)
|
||||
|
||||
Reference in New Issue
Block a user