Re: [Numpy-discussion] New random.Generator method: permuted

2020-08-05 Thread Sebastian Berg
On Mon, 2020-08-03 at 14:09 -0400, Warren Weckesser wrote:
> In one of the previous weekly zoom meetings, it was suggested
> to ping the mailing list about an updated PR that implements
> the `permuted` method for the Generator class in numpy.random.
> The relevant issue is
> 
> https://github.com/numpy/numpy/issues/5173
> 
> and the PR is
> 
> https://github.com/numpy/numpy/pull/15121
> 
> The new method (as it would be called from Python) is
> 
> permuted(x, axis=None, out=None)
> 

I like the proposed API and name personally, and think we should go
ahead with it. It is a useful complement to `shuffle` (and sorting). 

The followup questions of adding `shuffled`, and what to do about
`permutation` are important, but I agree with viewing them as a second
step.

This API has been discussed a few times in various depths, so I assume
that `permuted` as a name and API has largely settle down, and reached
consensus (at last if there is not more activity here or on the PR).

So, as a heads up, I am planning to review and push that forward in the
next days, but more discussion is of course welcome. We still have time
to decide differently.

Cheers,

Sebastian


> The CircleCI rendering of the docstring from the pull request is
> 
> 
> https://14745-908607-gh.circle-artifacts.com/0/doc/build/html/reference/random/generated/numpy.random.Generator.permuted.html
> 
> The new method is an alternative to the existing `shuffle` and
> `permutation` methods.  It handles the `axis` parameter similar
> to how the sort methods do, i.e. when `axis` is given, the slices
> along the axis are shuffled independently.  This new documentation
> (added as part of the pull request) explains the API of the various
> related methods:
> 
> 
> https://14745-908607-gh.circle-artifacts.com/0/doc/build/html/reference/random/generator.html#permutations
> 
> Additional feedback on the implementation of `permuted` in the
> pull request is welcome.  Further discussion of the API should
> be held in the issue gh-5173 (but please familiarize yourself
> with the discussion of the API in gh-5173--there has already
> been quite a long discussion of several different APIs).
> 
> Thanks,
> 
> Warren
> ___
> 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


[Numpy-discussion] Building Numpy Documentation

2020-08-05 Thread cooperrc
I'm trying to build NumPy and its documentation from the current git repo,
but I'm hitting a snag. I keep getting a RuntimeError:


I'm trying to build NumPy inside the cloned repository from my fork. I'm
running Arch (kernel 5.7.12) with gcc and gcc-libs installed. I'm using a
fresh conda environment that has only installed Python 3.8 and Cython. 

Any way I can troubleshoot this issue?




--
Sent from: http://numpy-discussion.10968.n7.nabble.com/
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Building Numpy Documentation

2020-08-05 Thread Ralf Gommers
On Wed, Aug 5, 2020 at 7:58 PM cooperrc  wrote:

> I'm trying to build NumPy and its documentation from the current git repo,
> but I'm hitting a snag. I keep getting a RuntimeError:
>
>
> I'm trying to build NumPy inside the cloned repository from my fork. I'm
> running Arch (kernel 5.7.12) with gcc and gcc-libs installed. I'm using a
> fresh conda environment that has only installed Python 3.8 and Cython.
>
> Any way I can troubleshoot this issue?
>

Opening an issue and including the command you're running and the full
build/test log ending in that RuntimeError would be the way to get the
input you need.

Cheers,
Ralf


>
>
>
> --
> Sent from: http://numpy-discussion.10968.n7.nabble.com/
> ___
> 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] Add Chebyshev (cosine) transforms implemented via FFTs

2020-08-05 Thread Ben Nathanson
> 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.

Exactly this sentence might be useful on top of the FFT page.

Is the right page reference/routines.fft.html? I can submit a PR.
___
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-05 Thread Ralf Gommers
On Wed, Aug 5, 2020 at 8:16 PM Ben Nathanson 
wrote:

> > 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.
>
> Exactly this sentence might be useful on top of the FFT page.
>
> Is the right page reference/routines.fft.html? I can submit a PR.
>

A PR would be great, thanks Ben. And yes, that's the right page.

Cheers,
Ralf

___
> 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] Building Numpy Documentation

2020-08-05 Thread cooperrc
Thanks! I'll post the issue and full output. 



--
Sent from: http://numpy-discussion.10968.n7.nabble.com/
___
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-05 Thread Chris Val
Stephan Hoyer-2 wrote
> On Tue, Aug 4, 2020 at 6:10 PM Charles R Harris <

> charlesr.harris@

> >
> wrote:
> 
>>
>>
>> On Tue, Aug 4, 2020 at 4:55 AM Ralf Gommers <

> ralf.gommers@

> >
>> wrote:
>>
>>>
>>>
>>> On Tue, Aug 4, 2020 at 1:49 AM Chris Vavaliaris <

> cv1038@.unh

> >
>>> 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@

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

> NumPy-Discussion@

> https://mail.python.org/mailman/listinfo/numpy-discussion

Thank you all for the replies and feedback! I now have a better
understanding of the differences between the NumPy and SciPy FFT modules; it
certainly looks like SciPy would be a more appropriate place for such a
feature. 

> Chebfun is based around this method, they use series with possibly
> thousands of terms. Trefethen is a big fan of Chebyshev polynomials.
> 
> Chuck

Thank you Chuck for your comment; yes I'm aware of Chebfun and of
Trefethen's work in general, it's mostly the work of his and some of his
past grad students that got me interested in Chebyshev methods in the first
place!

Chris




--
Sent from: http://numpy-discussion.10968.n7.nabble.com/
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion