Change Exception type for wrong input dims

This commit is contained in:
Johannes Schönberger
2012-10-08 10:55:19 +02:00
committed by Stefan van der Walt
parent b70f279f27
commit 615f6818eb
2 changed files with 2 additions and 2 deletions
+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__':