mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 16:14:56 +08:00
Add deprecation warning for old syntax for integrate()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user