[Numpy-discussion] another discussion on numpy correlate (and convolution)
Matthew Brett
matthew.brett at gmail.com
Tue Feb 26 03:39:46 EST 2013
Hi,
On Tue, Feb 26, 2013 at 12:20 AM, Pierre Haessig
<pierre.haessig at 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
mode?
> 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
away.
Cheers,
Matthew
More information about the NumPy-Discussion
mailing list