arraypad: allow padding with zero entries (i.e. no padding).

This commit is contained in:
Jostein Bø Fløystad
2013-07-05 14:29:09 +02:00
parent 24c0c40977
commit 794a4d7dae
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1085,7 +1085,7 @@ def _validate_lengths(narray, number_elements):
normshp = _normalize_shape(narray, number_elements)
for i in normshp:
chk = [1 if x is None else x for x in i]
chk = [1 if x > 0 else -1 for x in chk]
chk = [1 if x >= 0 else -1 for x in chk]
if (chk[0] < 0) or (chk[1] < 0):
fmt = "%s cannot contain negative values."
raise ValueError(fmt % (number_elements,))