mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-29 11:26:57 +08:00
Use normal deprecation warning
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user