[SciPy-Dev] ndimage reflect mode

Matthew Brett matthew.brett at gmail.com
Mon Nov 3 13:31:56 EST 2014


On Fri, Oct 31, 2014 at 12:16 AM, Matthew Brett <matthew.brett at gmail.com> wrote:
> Hi,
>
> Sorry if this is a dumb question, but I just noticed some behavior of
> scipy.ndimage that surprised me:
>
> In [63]: oned = np.arange(1, 10, dtype=float)
> In [64]: scipy.ndimage.affine_transform(oned, [1], [-2], mode='reflect')
> Out[64]: array([ 2.,  1.,  1.,  2.,  3.,  4.,  5.,  6.,  7.])
>
> OK so far.  But this I was surprised by:
>
> In [68]: scipy.ndimage.affine_transform(oned, [1], [-2 - 1e-15], mode='reflect')
> Out[68]: array([ 2.,  1.,  2.,  2.,  3.,  4.,  5.,  6.,  7.])
>
> Why did the third value turn from a 1 into a 2?  I am missing something obvious?

I assume for lack of answers that this is a bug?

Any objections to opening this as an issue?

Matthew



More information about the SciPy-Dev mailing list