[Numpy-discussion] another discussion on numpy correlate (and convolution)

Matthew Brett matthew.brett@gmail....
Tue Feb 26 02:39:46 CST 2013


On Tue, Feb 26, 2013 at 12:20 AM, Pierre Haessig
<pierre.haessig@crans.org> wrote:
> Hi,
> Le 22/02/2013 17:40, Matthew Brett a écrit :
>> >From complete ignorance, do you think it is an option to allow a
>> (n_left, n_right) tuple as a value for 'mode'?
> That may be an option. Another one would be to add some kind of `bounds`
> option which would be set to None by default but would accept the
> (n_left, n_right) tuple and would override `mode`.
> I don't know which one is better.

Personally I try to avoid mutually incompatible arguments.  I guess
you'd have to raise and error if the bounds were defined as well as

> The only thing I've in mind which may cause confusion is that `mode`
> normally receives a string ('valid', 'same', 'full') but it also accept
> corresponding integer codes (undocumented, but I guess it corresponds to
> a old signature of that function). So I wonder if there could be a
> confusion between :
> * mode = n
> * mode = (n_left, n_right)

Maybe deprecate the integer arguments?   It doesn't seem too bad to me
that the numbers in the tuple are different in meaning from a scalar,
particularly if the scalar argument is undocumented and will soon go



More information about the NumPy-Discussion mailing list