Add docstring to assert_nD

This commit is contained in:
Steven Silvester
2014-09-20 19:58:20 -05:00
parent 6a05edb9ea
commit d2aaae40c8
+12
View File
@@ -144,6 +144,18 @@ def safe_as_int(val, atol=1e-3):
def assert_nD(array, arg_name='image', ndim=2):
"""
Verify an arry meets the desired ndims.
Parameters
----------
array : array-like
Input array to be validated
arg_name : str
The name of the array in the original function.
ndim : int or array-like
Allowable ndim or ndims for the array.
"""
array = np.asanyarray(array)
msg = "The parameter `%s` must be a %s-dimensional array"
if isinstance(ndim, int):