mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
MAINT: All modes in _shared.interpolation.pxd were changed to be consistent with numpy.pad naming conventions. Specifically 'nearest' was changed to 'edge' and 'mirror' was changed to 'reflect'. All functions with a mode argument that rely on these functions had their inputs changed accordingly. For now there is a deprecation warning if the user supplies mode 'nearest'. Mode 'mirror' never appeared in an official release of skimage and so has no corresponding deprecation warning.
This commit is contained in:
@@ -163,3 +163,14 @@ def assert_nD(array, ndim, arg_name='image'):
|
||||
ndim = [ndim]
|
||||
if not array.ndim in ndim:
|
||||
raise ValueError(msg % (arg_name, '-or-'.join([str(n) for n in ndim])))
|
||||
|
||||
|
||||
def _mode_deprecations(mode):
|
||||
""" to be used by functions to update deprecated mode names in
|
||||
`skimage._shared.interpolation.pyx`."""
|
||||
if mode.lower() == 'nearest':
|
||||
warnings.warn(skimage_deprecation(
|
||||
"Mode 'nearest' has been renamed 'edge'. Mode 'nearest' will be "
|
||||
"removed in a future release."))
|
||||
mode = 'edge'
|
||||
return mode
|
||||
|
||||
Reference in New Issue
Block a user