diff --git a/skimage/_shared/utils.py b/skimage/_shared/utils.py index 40703206..612a2b63 100644 --- a/skimage/_shared/utils.py +++ b/skimage/_shared/utils.py @@ -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. diff --git a/skimage/exposure/exposure.py b/skimage/exposure/exposure.py index ad21fa9b..3a2accbc 100644 --- a/skimage/exposure/exposure.py +++ b/skimage/exposure/exposure.py @@ -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))