Use normal deprecation warning

This commit is contained in:
Tony S Yu
2014-07-11 17:01:54 -05:00
parent 879c2c7f36
commit 4c000c4d89
2 changed files with 2 additions and 13 deletions
-10
View File
@@ -19,16 +19,6 @@ class skimage_deprecation(Warning):
pass
def deprecation_warning(msg, **kwargs):
"""Emit deprecation warning for scikit-image.
Unlike default deprecation warnings, this is not silenced by default.
Additional keyword arguments are passed to `warnings.warn`.
"""
warnings.simplefilter('always', skimage_deprecation)
warnings.warn(msg, category=skimage_deprecation, **kwargs)
class deprecated(object):
"""Decorator to mark deprecated functions with warning.
+2 -3
View File
@@ -3,7 +3,6 @@ import numpy as np
from skimage import img_as_float
from skimage.util.dtype import dtype_range, dtype_limits
from skimage._shared.utils import deprecation_warning
__all__ = ['histogram', 'cumulative_distribution', 'equalize',
@@ -255,12 +254,12 @@ def rescale_intensity(image, in_range='image', out_range='dtype'):
if in_range is None:
in_range = 'image'
msg = "`in_range` should not be set to None. Use {!r} instead."
deprecation_warning(msg.format(in_range))
warnings.warn(msg.format(in_range))
if out_range is None:
out_range = 'dtype'
msg = "`out_range` should not be set to None. Use {!r} instead."
deprecation_warning(msg.format(out_range))
warnings.warn(msg.format(out_range))
imin, imax = intensity_range(image, in_range)
omin, omax = intensity_range(image, out_range, clip_negative=(imin >= 0))