"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/_shared/tests/test_utils.py" between
scikit-image-0.19.1.tar.gz and scikit-image-0.19.2.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

test_utils.py  (scikit-image-0.19.1):test_utils.py  (scikit-image-0.19.2)
import sys import sys
import warnings import warnings
import inspect
import numpy as np import numpy as np
import pytest import pytest
from skimage._shared import testing from skimage._shared import testing
from skimage._shared.utils import (check_nD, deprecate_kwarg, from skimage._shared.utils import (check_nD, deprecate_kwarg,
_validate_interpolation_order, _validate_interpolation_order,
change_default_value, remove_arg, change_default_value, remove_arg,
_supported_float_type, _supported_float_type,
channel_as_last_axis) channel_as_last_axis)
from skimage.feature import hog
from skimage.transform import pyramid_gaussian
complex_dtypes = [np.complex64, np.complex128] complex_dtypes = [np.complex64, np.complex128]
if hasattr(np, 'complex256'): if hasattr(np, 'complex256'):
complex_dtypes += [np.complex256] complex_dtypes += [np.complex256]
have_numpydoc = False have_numpydoc = False
try: try:
import numpydoc import numpydoc
have_numpydoc = True have_numpydoc = True
except ImportError: except ImportError:
skipping to change at line 266 skipping to change at line 269
# Verify that channel_as_last_axis modifies the channel_axis as expected # Verify that channel_as_last_axis modifies the channel_axis as expected
# need unique size per axis here # need unique size per axis here
x = np.zeros((2, 3, 4)) x = np.zeros((2, 3, 4))
size = _decorated_channel_axis_size(x, channel_axis=channel_axis) size = _decorated_channel_axis_size(x, channel_axis=channel_axis)
if channel_axis is None: if channel_axis is None:
assert size is None assert size is None
else: else:
assert size == x.shape[channel_axis] assert size == x.shape[channel_axis]
def test_decorator_warnings():
"""Assert that warning message issued by decorator points to
expected file and line number.
"""
with pytest.warns(FutureWarning) as record:
pyramid_gaussian(None, multichannel=True)
expected_lineno = inspect.currentframe().f_lineno - 1
assert record[0].lineno == expected_lineno
assert record[0].filename == __file__
img = np.random.rand(100, 100, 3)
with pytest.warns(FutureWarning) as record:
hog(img, multichannel=True)
expected_lineno = inspect.currentframe().f_lineno - 1
assert record[0].lineno == expected_lineno
assert record[0].filename == __file__
 End of changes. 3 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)