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:
Gregory R. Lee
2015-08-13 23:39:55 -04:00
parent 8e3b6bc9da
commit 81ea7a6e34
10 changed files with 109 additions and 62 deletions
+11
View File
@@ -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