[Numpy-discussion] how to name "contagious" keyword in np.ma.convolve

2016-10-14 Thread Allan Haldane
Hi all,

Eric Wieser has a PR which defines new functions np.ma.correlate and
np.ma.convolve:

https://github.com/numpy/numpy/pull/7922

We're deciding how to name the keyword arg which determines whether
masked elements are "propagated" in the convolution sums. Currently we
are leaning towards calling it "contagious", with default of True:

def convolve(a, v, mode='full', contagious=True):

Any thoughts?

Cheers,
Allan

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to name "contagious" keyword in np.ma.convolve

2016-10-14 Thread Sebastian Berg
On Fr, 2016-10-14 at 13:00 -0400, Allan Haldane wrote:
> Hi all,
> 
> Eric Wieser has a PR which defines new functions np.ma.correlate and
> np.ma.convolve:
> 
> https://github.com/numpy/numpy/pull/7922
> 
> We're deciding how to name the keyword arg which determines whether
> masked elements are "propagated" in the convolution sums. Currently
> we
> are leaning towards calling it "contagious", with default of True:
> 
> def convolve(a, v, mode='full', contagious=True):
> 
> Any thoughts?
> 

Sounds a bit overly odd to me to be honest. Just brain storming, you
could think/name it the other way around maybe? Should the masked
values be considered as zero/ignored?

- Sebastian


> Cheers,
> Allan
> 
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> 

signature.asc
Description: This is a digitally signed message part
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to name "contagious" keyword in np.ma.convolve

2016-10-14 Thread Benjamin Root
Why not "propagated"?

On Fri, Oct 14, 2016 at 1:08 PM, Sebastian Berg 
wrote:

> On Fr, 2016-10-14 at 13:00 -0400, Allan Haldane wrote:
> > Hi all,
> >
> > Eric Wieser has a PR which defines new functions np.ma.correlate and
> > np.ma.convolve:
> >
> > https://github.com/numpy/numpy/pull/7922
> >
> > We're deciding how to name the keyword arg which determines whether
> > masked elements are "propagated" in the convolution sums. Currently
> > we
> > are leaning towards calling it "contagious", with default of True:
> >
> > def convolve(a, v, mode='full', contagious=True):
> >
> > Any thoughts?
> >
>
> Sounds a bit overly odd to me to be honest. Just brain storming, you
> could think/name it the other way around maybe? Should the masked
> values be considered as zero/ignored?
>
> - Sebastian
>
>
> > Cheers,
> > Allan
> >
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org
> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to name "contagious" keyword in np.ma.convolve

2016-10-14 Thread Allan Haldane
I think the possibilities that have been mentioned so far (here or in
the PR) are:

contagious
contagious_mask
propagate
propagate_mask
propagated

`propogate_mask=False` seemed to imply that the mask would never be set,
so Eric also suggested
propagate_mask='any' or propagate_mask='all'


I would be happy with 'propagated=False' as the name/default. As Eric
pointed out, most MaskedArray functions like sum implicitly don't
propagate, currently, so maybe we should do likewise here.


Allan

On 10/14/2016 01:44 PM, Benjamin Root wrote:
> Why not "propagated"?
> 
> On Fri, Oct 14, 2016 at 1:08 PM, Sebastian Berg
> mailto:sebast...@sipsolutions.net>> wrote:
> 
> On Fr, 2016-10-14 at 13:00 -0400, Allan Haldane wrote:
> > Hi all,
> >
> > Eric Wieser has a PR which defines new functions np.ma.correlate and
> > np.ma.convolve:
> >
> > https://github.com/numpy/numpy/pull/7922
> 
> >
> > We're deciding how to name the keyword arg which determines whether
> > masked elements are "propagated" in the convolution sums. Currently
> > we
> > are leaning towards calling it "contagious", with default of True:
> >
> > def convolve(a, v, mode='full', contagious=True):
> >
> > Any thoughts?
> >
> 
> Sounds a bit overly odd to me to be honest. Just brain storming, you
> could think/name it the other way around maybe? Should the masked
> values be considered as zero/ignored?
> 
> - Sebastian
> 
> 
> > Cheers,
> > Allan
> >
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org 
> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> 
> >
> 
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org 
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> 
> 
> 
> 
> 
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> 

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to name "contagious" keyword in np.ma.convolve

2016-10-14 Thread Juan Nunez-Iglesias
+1 for propagate_mask. That is the only proposal that immediately makes sense 
to me. "contagious" may be cute but I think approximately 0% of users would 
guess its purpose on first use.

Can you elaborate on what happens with the masks exactly? I didn't quite get 
why propagate_mask=False was unintuitive. My expectation is that any mask 
present in the input will not be set in the output, but the mask will be 
"respected" by the function.

On 15 Oct. 2016, 5:23 AM +1100, Allan Haldane , wrote:
> I think the possibilities that have been mentioned so far (here or in
> the PR) are:
>
> contagious
> contagious_mask
> propagate
> propagate_mask
> propagated
>
> `propogate_mask=False` seemed to imply that the mask would never be set,
> so Eric also suggested
> propagate_mask='any' or propagate_mask='all'
>
>
> I would be happy with 'propagated=False' as the name/default. As Eric
> pointed out, most MaskedArray functions like sum implicitly don't
> propagate, currently, so maybe we should do likewise here.
>
>
> Allan
>
> On 10/14/2016 01:44 PM, Benjamin Root wrote:
> > Why not "propagated"?
> >
> > On Fri, Oct 14, 2016 at 1:08 PM, Sebastian Berg
> > mailto:sebast...@sipsolutions.net>> wrote:
> >
> > On Fr, 2016-10-14 at 13:00 -0400, Allan Haldane wrote:
> > > Hi all,
> > >
> > > Eric Wieser has a PR which defines new functions np.ma.correlate and
> > > np.ma.convolve:
> > >
> > > https://github.com/numpy/numpy/pull/7922
> >  > >
> > > We're deciding how to name the keyword arg which determines whether
> > > masked elements are "propagated" in the convolution sums. Currently
> > > we
> > > are leaning towards calling it "contagious", with default of True:
> > >
> > > def convolve(a, v, mode='full', contagious=True):
> > >
> > > Any thoughts?
> > >
> >
> > Sounds a bit overly odd to me to be honest. Just brain storming, you
> > could think/name it the other way around maybe? Should the masked
> > values be considered as zero/ignored?
> >
> > - Sebastian
> >
> >
> > > Cheers,
> > > Allan
> > >
> > > ___
> > > NumPy-Discussion mailing list
> > > NumPy-Discussion@scipy.org  > > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >  > >
> >
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org  > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >  >
> >
> >
> >
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org
> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion