From f8d34e8bf91f1fed3970b770abdfec94efc949df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 10 Oct 2013 09:10:42 +0200 Subject: [PATCH] Deprecate out parameter --- TODO.txt | 1 + skimage/morphology/binary.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/TODO.txt b/TODO.txt index db7ffe48..29d1ebac 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,6 +6,7 @@ Version 0.10 * Remove {`ratio`, `sigma`} deprecation warnings of `skimage.segmentation.slic` * Change default mode of random_walker segmentation to 'cg_mg' > 'cg' > 'bf', depending on which optional dependencies are available. +* Remove deprecated `out` parameter of `skimage.morphology.binary_*` Version 0.9 ----------- diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index d248d8db..11a14d49 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -1,3 +1,4 @@ +import warnings import numpy as np from scipy import ndimage @@ -15,6 +16,9 @@ def _convolve(image, selem, out, cval): if out is None: out = np.zeros_like(image, dtype=out_dtype) else: + warnings.warn('Parameter `out` is deprecated and it does not equal ' + 'the output image if the sum of the structuring element ' + 'overflows the dtype of `out`.') iinfo = np.iinfo(out.dtype) if iinfo.max - iinfo.min < selem_sum: raise ValueError('Sum of structuring (=%d) element results in '