From 30636428db4e0749b612645cb0e46bfc6a9a3373 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 14 Mar 2013 18:52:30 +1100 Subject: [PATCH] Add more descriptive error message to _prepare_colorarray --- skimage/color/colorconv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skimage/color/colorconv.py b/skimage/color/colorconv.py index be2f1519..540c5a75 100644 --- a/skimage/color/colorconv.py +++ b/skimage/color/colorconv.py @@ -130,7 +130,8 @@ def _prepare_colorarray(arr): arr = np.asanyarray(arr) if arr.ndim not in [3, 4] or arr.shape[-1] != 3: - msg = "the input array must be have a shape == (.., ..,[ ..,] 3))" + msg = ("the input array must be have a shape == (.., ..,[ ..,] 3)), " + + "got (" + (", ".join(map(str, arr.shape))) + ")") raise ValueError(msg) return dtype.img_as_float(arr)