Re: [Numpy-discussion] Convolution of NumPy arrays of arbitrary dimension

2018-08-11 Thread Foad Sojoodi Farimani
Hi Hameer,

Thanks for the reply. I have indeed seen scipy.ndimage.convolve and have
mentioned it in the OP
.
but some questions:


   1. although there is nothing about the dimension of the ndarrays in its
   official page
   
,
   but I haven't seen any examples showing it works with higher dimensions.
   2. the only generalization I know of is astropy.convolution
    which works up to 3D.
   3. what is the difference between seen scipy.ndimage
   and scipy.signal.convolve? It seems to me the later is for function
   analysis  not array
   arithmetics.
   4. As I can see the term convolution, even for array, arithmetics has
   different meanings. For example there is
   also scipy.ndimage.filters.convolve which apparently calculate things in a
   different way. My final goal is do finite multivariate formal power series
   multiplication (Cauchy product). I think I have figured the formula out
   here
   
,
   but I'm not sure if it is correct completely. questions are:
  1. is my formula correct?
 - if not what is the correct one?
 2. if yes has this been done before?
  - if yes where? does any of the above functions do the job?
 3. if not is my implementation correct so far?
  4. how to finish the final step to populate the ndarray using the
  conv function?

Thanks a gain and looking forwards to hearing back.

Best,
Foad

On Sat, Aug 11, 2018 at 7:39 AM  wrote:

> On 11. Aug 2018, at 00:24, Foad Sojoodi Farimani 
> wrote:
>
> Hello everyone,
>
> My first email here, so sorry in advance if I'm violating any rules.
> I'm trying to implement the convolution of NumPy arrays of arbitrary
> dimension in order to get Cauchy product of multivariate power series.
> However I have some issues. I was wondering maybe you can help and this
> might also be of your interest.  I have explained everything here in this
> StackOverflow post:
>
> http://bit.ly/2MhJCex
>
> I would appreciate if you could help me figure this out. Thanks in advance.
>
> Best,
> Foad
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
>
> Hi Foad, you can use scipy.signal.convolve. It works on N-D arrays.
>
> Best Regards
> Hameer Abbasi
> Sent from my iPhone
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Stacklevel for warnings.

2018-08-11 Thread Sebastian Berg
On Fri, 2018-08-10 at 16:05 -0600, Charles R Harris wrote:
> Hi All,
> 
> Do we have a policy for the stacklevel that should be used in NumPy?
> How far back should the stack be displayed? I note that the optimum
> stacklevel may vary between users and developers.
> 

I thought it was so that it will point to the correct user line (or
tend to point there). So stacklevel=2 for exposed and higher for
private (python) functions IIRC.
As for developers, I would hope they are OK with (and know how to)
turning the warning into an error.

Not sure we discussed it much, I seem to have a vague memory of asking
if we are sure this is what we want and at least Ralf agreeing. Also I
don't know how consistent it is overall.

- Sebastian


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

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


Re: [Numpy-discussion] Stacklevel for warnings.

2018-08-11 Thread Ralf Gommers
On Sat, Aug 11, 2018 at 1:22 AM, Sebastian Berg 
wrote:

> On Fri, 2018-08-10 at 16:05 -0600, Charles R Harris wrote:
> > Hi All,
> >
> > Do we have a policy for the stacklevel that should be used in NumPy?
> > How far back should the stack be displayed? I note that the optimum
> > stacklevel may vary between users and developers.
> >
>
> I thought it was so that it will point to the correct user line (or
> tend to point there). So stacklevel=2 for exposed and higher for
> private (python) functions IIRC.
> As for developers, I would hope they are OK with (and know how to)
> turning the warning into an error.
>
> Not sure we discussed it much, I seem to have a vague memory of asking
> if we are sure this is what we want and at least Ralf agreeing. Also I
> don't know how consistent it is overall.
>

That sounds right to me. I think when it was introduced it was quite
consistent, because Sebastian replace warning filters everywhere with
suppress_warnings. Would be good to document this in the devguide.

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


[Numpy-discussion] Does numpy need a *.dist-info directory? What is the status of setuptools?

2018-08-11 Thread Charles R Harris
Hi All,

A question for any packaging gurus out there, should NumPy have a
*.dist-info  directory? I note
that currently we have a *.egg-info directory. I also have a question as to
what role setuptools should have going forward. Should we still rely on
them, or has pip matured to the degree that we no longer need it. Note that
we will only be supporting Python >= 3.5 in the near future.

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


Re: [Numpy-discussion] Stacklevel for warnings.

2018-08-11 Thread Sebastian Berg
On Sat, 2018-08-11 at 11:11 -0700, Ralf Gommers wrote:
> 
> 
> On Sat, Aug 11, 2018 at 1:22 AM, Sebastian Berg  ns.net> wrote:
> > On Fri, 2018-08-10 at 16:05 -0600, Charles R Harris wrote:
> > > Hi All,
> > > 
> > > Do we have a policy for the stacklevel that should be used in
> > NumPy?
> > > How far back should the stack be displayed? I note that the
> > optimum
> > > stacklevel may vary between users and developers.
> > > 
> > 
> > I thought it was so that it will point to the correct user line (or
> > tend to point there). So stacklevel=2 for exposed and higher for
> > private (python) functions IIRC.
> > As for developers, I would hope they are OK with (and know how to)
> > turning the warning into an error.
> > 
> > Not sure we discussed it much, I seem to have a vague memory of
> > asking
> > if we are sure this is what we want and at least Ralf agreeing.
> > Also I
> > don't know how consistent it is overall.
> 
> That sounds right to me. I think when it was introduced it was quite
> consistent, because Sebastian replace warning filters everywhere with
> suppress_warnings. Would be good to document this in the devguide.

Yeah, probably reasonably consistent, but I only added a test to check
that the stacklevel argument is never missing entirely, it is up to the
author to figure out what is the right level (or best easily possible,
since sometimes it would be pretty ugly to make it always right).

The warning testing (suppress_warnings, etc.) or any of our tests never
actually check the stacklevel that I am aware of, or maybe I forgot :),
could be something to think about though. I guess we did it around the
same time of the general warning testing cleanup probably.

- Sebastian



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

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


Re: [Numpy-discussion] Does numpy need a *.dist-info directory? What is the status of setuptools?

2018-08-11 Thread Ralf Gommers
On Sat, Aug 11, 2018 at 11:29 AM, Charles R Harris <
charlesr.har...@gmail.com> wrote:

> Hi All,
>
> A question for any packaging gurus out there, should NumPy have a
> *.dist-info  directory? I note
> that currently we have a *.egg-info directory.
>

Those are both autogenerated, we don't have those in the repo. The current
state of our packaging is fine in that respect.


> I also have a question as to what role setuptools should have going
> forward. Should we still rely on them, or has pip matured to the degree
> that we no longer need it. Note that we will only be supporting Python >=
> 3.5 in the near future.
>

Pip is not a build tool, it invokes setuptools. The only viable alternative
to setuptools at the moment is scikit-build. But I'm not in a hurry to
switch, I'd rather try scikit-build on less critical packages than numpy
first.

Cheers,
Ralf



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


Re: [Numpy-discussion] Does numpy need a *.dist-info directory? What is the status of setuptools?

2018-08-11 Thread Charles R Harris
On Sat, Aug 11, 2018 at 1:13 PM, Ralf Gommers 
wrote:

>
>
> On Sat, Aug 11, 2018 at 11:29 AM, Charles R Harris <
> charlesr.har...@gmail.com> wrote:
>
>> Hi All,
>>
>> A question for any packaging gurus out there, should NumPy have a
>> *.dist-info  directory? I
>> note that currently we have a *.egg-info directory.
>>
>
> Those are both autogenerated, we don't have those in the repo. The current
> state of our packaging is fine in that respect.
>
>
>> I also have a question as to what role setuptools should have going
>> forward. Should we still rely on them, or has pip matured to the degree
>> that we no longer need it. Note that we will only be supporting Python >=
>> 3.5 in the near future.
>>
>
> Pip is not a build tool, it invokes setuptools. The only viable
> alternative to setuptools at the moment is scikit-build. But I'm not in a
> hurry to switch, I'd rather try scikit-build on less critical packages than
> numpy first.
>

I was more thinking of distutils vs setuptools, but maybe I am
misunderstanding the relationship between the two.

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


Re: [Numpy-discussion] Does numpy need a *.dist-info directory? What is the status of setuptools?

2018-08-11 Thread Ralf Gommers
On Sat, Aug 11, 2018 at 12:17 PM, Charles R Harris <
charlesr.har...@gmail.com> wrote:

>
>
> On Sat, Aug 11, 2018 at 1:13 PM, Ralf Gommers 
> wrote:
>
>>
>>
>> On Sat, Aug 11, 2018 at 11:29 AM, Charles R Harris <
>> charlesr.har...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> A question for any packaging gurus out there, should NumPy have a
>>> *.dist-info  directory? I
>>> note that currently we have a *.egg-info directory.
>>>
>>
>> Those are both autogenerated, we don't have those in the repo. The
>> current state of our packaging is fine in that respect.
>>
>>
>>> I also have a question as to what role setuptools should have going
>>> forward. Should we still rely on them, or has pip matured to the degree
>>> that we no longer need it. Note that we will only be supporting Python >=
>>> 3.5 in the near future.
>>>
>>
>> Pip is not a build tool, it invokes setuptools. The only viable
>> alternative to setuptools at the moment is scikit-build. But I'm not in a
>> hurry to switch, I'd rather try scikit-build on less critical packages than
>> numpy first.
>>
>
> I was more thinking of distutils vs setuptools, but maybe I am
> misunderstanding the relationship between the two.
>

We don't want to go back to distutils-only; there are some advantages to
setuptools and it's gotten less bad at breaking numpy.distutils over the
last years. And anyway, even if we would switch away from setuptools, pip
will enable setuptools before calling our own setup.py and at that point
setuptools has already done its monkeypatch-distutils dance. So there's no
point avoiding setuptools.

Ralf





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