Add deprecation warning for old syntax for integrate()

This commit is contained in:
Juan Nunez-Iglesias
2015-12-13 14:45:45 +11:00
parent 38b1880ef7
commit 458dc15225
+5 -1
View File
@@ -1,6 +1,6 @@
import numpy as np
import collections
import warnings
def integral_image(img):
"""Integral image / summed area table.
@@ -82,6 +82,10 @@ def integrate(ii, start, end, *args):
end = np.array(end)
# handle deprecated input format
else:
warnings.warn("The syntax 'integrate(ii, r0, c0, r1, c1)' is "
"deprecated, and will be phased out in release 0.14. "
"The new syntax is "
"'integrate(ii, [(r0, c0)], [(r1, c1)])'.")
if isinstance(start, collections.Iterable):
rows = len(start)
args = (start, end) + args