mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 03:02:21 +08:00
Merge pull request #1367 from blink1073/fix-deprecated-decorators
FIX: Cannot use bare deprecated decorators
This commit is contained in:
@@ -36,7 +36,7 @@ denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
|
||||
(restoration.denoise_tv_chambolle)
|
||||
|
||||
# Backward compatibility v<0.11
|
||||
@deprecated
|
||||
@deprecated('skimage.feature.canny')
|
||||
def canny(*args, **kwargs):
|
||||
# Hack to avoid circular import
|
||||
from skimage.feature._canny import canny as canny_
|
||||
|
||||
@@ -23,7 +23,7 @@ denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
|
||||
(restoration.denoise_tv_chambolle)
|
||||
|
||||
# Backward compatibility v<0.11
|
||||
@deprecated
|
||||
@deprecated('skimage.feature.canny')
|
||||
def canny(*args, **kwargs):
|
||||
# Hack to avoid circular import
|
||||
from ..feature._canny import canny as canny_
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
from warnings import catch_warnings, simplefilter
|
||||
from ..._shared._warnings import expected_warnings
|
||||
from ...data import moon
|
||||
|
||||
|
||||
def test_filter_import():
|
||||
with catch_warnings():
|
||||
simplefilter('ignore')
|
||||
from skimage import filter as F
|
||||
|
||||
assert('sobel' in dir(F))
|
||||
assert F._import_warned
|
||||
|
||||
|
||||
def test_canny_import():
|
||||
data = moon()
|
||||
with expected_warnings(['skimage.feature.canny']):
|
||||
from skimage.filters import canny
|
||||
canny(data)
|
||||
@@ -1,10 +0,0 @@
|
||||
from warnings import catch_warnings, simplefilter
|
||||
|
||||
|
||||
def test_filter_import():
|
||||
with catch_warnings():
|
||||
simplefilter('ignore')
|
||||
from skimage import filter as F
|
||||
|
||||
assert('sobel' in dir(F))
|
||||
assert F._import_warned
|
||||
Reference in New Issue
Block a user