From d2aaae40c8c29b371a5f5eccd0ea7c26bb876e9d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 20 Sep 2014 19:58:20 -0500 Subject: [PATCH] Add docstring to assert_nD --- skimage/_shared/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/skimage/_shared/utils.py b/skimage/_shared/utils.py index 8143abc5..92d2f3c6 100644 --- a/skimage/_shared/utils.py +++ b/skimage/_shared/utils.py @@ -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):