mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 06:53:51 +08:00
Change Exception type for wrong input dims
This commit is contained in:
committed by
Stefan van der Walt
parent
b70f279f27
commit
615f6818eb
@@ -98,7 +98,7 @@ def find_contours(array, level,
|
||||
"""
|
||||
array = np.asarray(array, dtype=np.double)
|
||||
if array.ndim != 2:
|
||||
raise TypeError('Only 2D arrays are supported.')
|
||||
raise ValueError('Only 2D arrays are supported.')
|
||||
level = float(level)
|
||||
if (fully_connected not in _param_options or
|
||||
positive_orientation not in _param_options):
|
||||
|
||||
@@ -75,7 +75,7 @@ def test_memory_order():
|
||||
|
||||
def test_invalid_input():
|
||||
assert_raises(ValueError, find_contours, r, 0.5, 'foo', 'bar')
|
||||
assert_raises(TypeError, find_contours, r[..., None], 0.5)
|
||||
assert_raises(ValueError, find_contours, r[..., None], 0.5)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user