Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Joshua Wilson
Re Ralf's question: > Can you quantify the precision improvement (approximately)? On one level you'll get a large decrease in relative error around the zeros of the sinc function because argument reduction is being done by a number which is exactly representable in double precision (i.e. the numb

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Charles R Harris
On Wed, May 22, 2019 at 7:14 PM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > On a more general note, if we change to a ufunc, it will get us stuck with > sinc being the normalized version, where the units of the input have to be > in the half-cycles preferred by signal-processing peop

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Marten van Kerkwijk
On a more general note, if we change to a ufunc, it will get us stuck with sinc being the normalized version, where the units of the input have to be in the half-cycles preferred by signal-processing people rather than the radians preferred by mathematicians. In this respect, note that there is an

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Marten van Kerkwijk
> Otherwise, there should >>> be no change except additional features of ufuncs and the move to a C >>> implementation. >>> >> > I see this is one of the functions that uses asanyarray, so what about > impact on subclass behavior? > So, subclasses are passed on, as they are in ufuncs. In general,

Re: [Numpy-discussion] Keep __array_function__ unexposed by default for 1.17?

2019-05-22 Thread Marten van Kerkwijk
> If we want to keep an "off" switch we might want to add some sort of API > for exposing whether NumPy is using __array_function__ or not. Maybe > numpy.__experimental_array_function_enabled__ = True, so you can just test > `hasattr(numpy, '__experimental_array_function_enabled__')`? This is > ass

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Stephan Hoyer
On Wed, May 22, 2019 at 2:00 PM Ralf Gommers wrote: > > > On Wed, May 22, 2019 at 7:34 PM Nathan Goldbaum > wrote: > >> It might be worth using BigQuery to search the github repository public >> dataset for usages of np.sinc with keyword arguments. >> > > We spent some effort at Quansight to try

Re: [Numpy-discussion] Keep __array_function__ unexposed by default for 1.17?

2019-05-22 Thread Stephan Hoyer
On Wed, May 22, 2019 at 2:36 PM Ralf Gommers wrote: > I would still like to turn on __array_function__ in NumPy 1.17. At least, >>> let's try that for the release candidate and see how it goes. >>> >> > I agree. I'd actually suggest flipping the switch asap and see if it > causes any issues for p

Re: [Numpy-discussion] Keep __array_function__ unexposed by default for 1.17?

2019-05-22 Thread Ralf Gommers
On Wed, May 22, 2019 at 9:46 PM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > Hi Stephan, > > I'm quite happy with the idea of turning on __array_function__ but > postponing any formal solution to getting into the wrapped routines (i.e., > one can use __wrapped__, but it is an implemen

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Ralf Gommers
On Wed, May 22, 2019 at 7:34 PM Nathan Goldbaum wrote: > It might be worth using BigQuery to search the github repository public > dataset for usages of np.sinc with keyword arguments. > We spent some effort at Quansight to try different approaches to this. BigQuery turns out to be suboptimal, p

Re: [Numpy-discussion] Keep __array_function__ unexposed by default for 1.17?

2019-05-22 Thread Marten van Kerkwijk
Hi Stephan, I'm quite happy with the idea of turning on __array_function__ but postponing any formal solution to getting into the wrapped routines (i.e., one can use __wrapped__, but it is an implementation detail that is not documented and comes with absolutely no guarantees). That way, 1.17 wil

Re: [Numpy-discussion] Community Call -- May 22 (New time / platform)

2019-05-22 Thread Stefan van der Walt
Hi all, On Tue, 21 May 2019 10:06:30 -0700, Tyler Reddy wrote: > Hi, > > Starting from this week, the community meetings will be at a new time (11 > am Pacific Time) and on a new meeting platform (see the linked doc). > > Anyone is free to join and edit the work-in-progress meeting notes: > http

Re: [Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Nathan Goldbaum
It might be worth using BigQuery to search the github repository public dataset for usages of np.sinc with keyword arguments. On Wed, May 22, 2019 at 1:05 PM Sebastian Berg wrote: > Hi all, > > there is an open PR (https://github.com/numpy/numpy/pull/12924) to > convert `np.sinc` into a ufunc. S

[Numpy-discussion] Converting np.sinc into a ufunc

2019-05-22 Thread Sebastian Berg
Hi all, there is an open PR (https://github.com/numpy/numpy/pull/12924) to convert `np.sinc` into a ufunc. Since it should improve general precision in `np.sinc`, I thought we could try to move that forward a bit. We check whether this is worth it or not in the end. However, it would also change

Re: [Numpy-discussion] Keep __array_function__ unexposed by default for 1.17?

2019-05-22 Thread Stephan Hoyer
Thanks for raising these concerns. The full implications of my recent __skip_array_function__ proposal are only now becoming evident to me now, looking at it's use in GH-13585. Guaranteeing that it does not expand NumPy's API surface seems hard to achieve without pervasive use of __skip_array_func