Re: [Numpy-discussion] Add Chebyshev (cosine) transforms implemented via FFTs

2020-08-04 Thread Ralf Gommers
On Tue, Aug 4, 2020 at 1:49 AM Chris Vavaliaris 
wrote:

> PR #16999: https://github.com/numpy/numpy/pull/16999
>
> Hello all,
> this PR adds the two 1D Chebyshev transform functions `chebyfft` and
> `ichebyfft` into the `numpy.fft` module, utilizing the real FFTs `rfft` and
> `irfft`, respectively. As far as I understand, `pockefft` does not support
> cosine transforms natively; for this reason, an even extension of the input
> vector is constructed, whose real FFT corresponds to a cosine transform.
>
> The motivation behind these two additions is the ability to quickly perform
> direct and inverse Chebyshev transforms with `numpy`, without the need to
> write scripts that do the necessary (although minor) modifications.
> Chebyshev transforms are used often e.g. in the spectral integration of PDE
> problems; thus, I believe having them implemented in `numpy` would be
> useful
> to many people in the community.
>
> I'm happy to get comments/feedback on this feature, and on whether it's
> something more people would be interested in. Also, I'm not entirely sure
> what part of this functionality is/isn't present in `scipy`, so that the
> two
> `fft` modules remain consistent with one another.
>

Hi Chris, that's a good question. scipy.fft is a superset of numpy.fft, and
the functionality included in NumPy is really only the basics that are
needed in many fields. The reason for the duplication stems from way back
when we had no wheels and SciPy was very hard to install. So I don't think
there's anything we'd add to numpy.fft at this point.

As I commented on your PR, it would be useful to add some references and
applications, and then make your proposal on the scipy-dev list.

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


[Numpy-discussion] NumPy Community Meeting Wednesday

2020-08-04 Thread Sebastian Berg
Hi all,

There will be a NumPy Community meeting Wednesday Agust 5th at 1pm
Pacific Time (20:00 UTC). Everyone is invited and encouraged to
join in and edit the work-in-progress meeting topics and notes at:

https://hackmd.io/76o-IxCjQX2mOXO_wwkcpg?both

Best wishes

Sebastian



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] Add Chebyshev (cosine) transforms implemented via FFTs

2020-08-04 Thread Charles R Harris
On Tue, Aug 4, 2020 at 4:55 AM Ralf Gommers  wrote:

>
>
> On Tue, Aug 4, 2020 at 1:49 AM Chris Vavaliaris 
> wrote:
>
>> PR #16999: https://github.com/numpy/numpy/pull/16999
>>
>> Hello all,
>> this PR adds the two 1D Chebyshev transform functions `chebyfft` and
>> `ichebyfft` into the `numpy.fft` module, utilizing the real FFTs `rfft`
>> and
>> `irfft`, respectively. As far as I understand, `pockefft` does not support
>> cosine transforms natively; for this reason, an even extension of the
>> input
>> vector is constructed, whose real FFT corresponds to a cosine transform.
>>
>> The motivation behind these two additions is the ability to quickly
>> perform
>> direct and inverse Chebyshev transforms with `numpy`, without the need to
>> write scripts that do the necessary (although minor) modifications.
>> Chebyshev transforms are used often e.g. in the spectral integration of
>> PDE
>> problems; thus, I believe having them implemented in `numpy` would be
>> useful
>> to many people in the community.
>>
>> I'm happy to get comments/feedback on this feature, and on whether it's
>> something more people would be interested in. Also, I'm not entirely sure
>> what part of this functionality is/isn't present in `scipy`, so that the
>> two
>> `fft` modules remain consistent with one another.
>>
>
> Hi Chris, that's a good question. scipy.fft is a superset of numpy.fft,
> and the functionality included in NumPy is really only the basics that are
> needed in many fields. The reason for the duplication stems from way back
> when we had no wheels and SciPy was very hard to install. So I don't think
> there's anything we'd add to numpy.fft at this point.
>
> As I commented on your PR, it would be useful to add some references and
> applications, and then make your proposal on the scipy-dev list.
>
>
Chebfun  is based around this method,
they use series with possibly thousands of terms. Trefethen is a big fan of
Chebyshev polynomials.

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


Re: [Numpy-discussion] Add Chebyshev (cosine) transforms implemented via FFTs

2020-08-04 Thread Stephan Hoyer
On Tue, Aug 4, 2020 at 6:10 PM Charles R Harris 
wrote:

>
>
> On Tue, Aug 4, 2020 at 4:55 AM Ralf Gommers 
> wrote:
>
>>
>>
>> On Tue, Aug 4, 2020 at 1:49 AM Chris Vavaliaris 
>> wrote:
>>
>>> PR #16999: https://github.com/numpy/numpy/pull/16999
>>>
>>> Hello all,
>>> this PR adds the two 1D Chebyshev transform functions `chebyfft` and
>>> `ichebyfft` into the `numpy.fft` module, utilizing the real FFTs `rfft`
>>> and
>>> `irfft`, respectively. As far as I understand, `pockefft` does not
>>> support
>>> cosine transforms natively; for this reason, an even extension of the
>>> input
>>> vector is constructed, whose real FFT corresponds to a cosine transform.
>>>
>>> The motivation behind these two additions is the ability to quickly
>>> perform
>>> direct and inverse Chebyshev transforms with `numpy`, without the need to
>>> write scripts that do the necessary (although minor) modifications.
>>> Chebyshev transforms are used often e.g. in the spectral integration of
>>> PDE
>>> problems; thus, I believe having them implemented in `numpy` would be
>>> useful
>>> to many people in the community.
>>>
>>> I'm happy to get comments/feedback on this feature, and on whether it's
>>> something more people would be interested in. Also, I'm not entirely sure
>>> what part of this functionality is/isn't present in `scipy`, so that the
>>> two
>>> `fft` modules remain consistent with one another.
>>>
>>
>> Hi Chris, that's a good question. scipy.fft is a superset of numpy.fft,
>> and the functionality included in NumPy is really only the basics that are
>> needed in many fields. The reason for the duplication stems from way back
>> when we had no wheels and SciPy was very hard to install. So I don't think
>> there's anything we'd add to numpy.fft at this point.
>>
>> As I commented on your PR, it would be useful to add some references and
>> applications, and then make your proposal on the scipy-dev list.
>>
>>
> Chebfun  is based around this method,
> they use series with possibly thousands of terms. Trefethen is a big fan of
> Chebyshev polynomials.
>

I am quite sure that Chebyshev transforms are useful, but it does feel like
something more directly suitable for SciPy than NumPy. The current division
for submodules like numpy.fft/scipy.fft and numpy.linalg/scipy.linalg
exists for outdated historical reasons, but at this point it is easiest for
users to understand if has SciPy has a strict superset of NumPy's
functionality here.


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