Change Exception type for wrong input dims

This commit is contained in:
Johannes Schönberger authored and Stefan van der Walt committed 2012-10-13 23:28:29 -07:00
1 parent b70f279f27
commit 615f6818eb
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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__':