Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-12 Thread Ralf Gommers
On Fri, Apr 10, 2020 at 7:18 PM Sebastian Berg wrote: > On Fri, 2020-04-10 at 18:19 +0200, Ralf Gommers wrote: > > On Fri, Apr 10, 2020 at 3:03 PM Sebastian Berg < > > sebast...@sipsolutions.net> > > wrote: > > > > > On Fri, 2020-04-10 at 12:27 +0200, Ralf Gommers wrote: > > > > > 3. I added feat

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-10 Thread Sebastian Berg
On Fri, 2020-04-10 at 18:19 +0200, Ralf Gommers wrote: > On Fri, Apr 10, 2020 at 3:03 PM Sebastian Berg < > sebast...@sipsolutions.net> > wrote: > > > On Fri, 2020-04-10 at 12:27 +0200, Ralf Gommers wrote: > > > > 3. I added features to allow transitioning:: > > > > > > > > get_array_module

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-10 Thread Ralf Gommers
On Fri, Apr 10, 2020 at 3:03 PM Sebastian Berg wrote: > On Fri, 2020-04-10 at 12:27 +0200, Ralf Gommers wrote: > > > 3. I added features to allow transitioning:: > > > > > > get_array_module(*arrays, modules="numpy", > > > future_modules=("dask.array", "cupy"), fallback="warn")

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-10 Thread Sebastian Berg
On Fri, 2020-04-10 at 12:27 +0200, Ralf Gommers wrote: > > 3. I added features to allow transitioning:: > > > > get_array_module(*arrays, modules="numpy", > > future_modules=("dask.array", "cupy"), fallback="warn") > > > >Will give FutureWarning/DeprecationWarning where necess

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-10 Thread Ralf Gommers
On Fri, Apr 10, 2020 at 5:17 AM Sebastian Berg wrote: > On Thu, 2020-04-09 at 13:52 +0200, Ralf Gommers wrote: > > On Thu, Apr 9, 2020 at 12:02 AM Sebastian Berg < > > sebast...@sipsolutions.net> > > wrote: > > > > > > > > > > I think it would be nice to have a separate NEP 37 implementation > >

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-10 Thread Ralf Gommers
On Thu, Apr 9, 2020 at 6:54 PM Sebastian Berg wrote: > On Thu, 2020-04-09 at 13:52 +0200, Ralf Gommers wrote: > > On Wed, Mar 4, 2020 at 1:22 AM Sebastian Berg < > > sebast...@sipsolutions.net> > > wrote: > > > > The NumPy version should normally be older than other libraries, and > > if > > > Nu

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-09 Thread Sebastian Berg
On Thu, 2020-04-09 at 22:11 -0500, Sebastian Berg wrote: > On Thu, 2020-04-09 at 13:52 +0200, Ralf Gommers wrote: > > On Thu, Apr 9, 2020 at 12:02 AM Sebastian Berg < > > sebast...@sipsolutions.net> > > wrote: > > > > > > > I think it would be nice to have a separate NEP 37 implementation > > ou

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-09 Thread Sebastian Berg
On Thu, 2020-04-09 at 13:52 +0200, Ralf Gommers wrote: > On Thu, Apr 9, 2020 at 12:02 AM Sebastian Berg < > sebast...@sipsolutions.net> > wrote: > > > > > I think it would be nice to have a separate NEP 37 implementation > outside > of NumPy to play with. Unlike __array_function__, I don't thin

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-09 Thread Sebastian Berg
On Thu, 2020-04-09 at 13:52 +0200, Ralf Gommers wrote: > On Wed, Mar 4, 2020 at 1:22 AM Sebastian Berg < > sebast...@sipsolutions.net> > wrote: > > > On Sun, 2020-02-23 at 22:44 -0800, Stephan Hoyer wrote: > > > On Sun, Feb 23, 2020 at 3:59 PM Ralf Gommers < > > > ralf.gomm...@gmail.com> > > > wro

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-09 Thread Ralf Gommers
On Thu, Apr 9, 2020 at 12:02 AM Sebastian Berg wrote: > On Wed, 2020-04-08 at 17:04 -0400, Andreas Mueller wrote: > > Hey all. > > Is there any update on this? Is there any input we can provide as > > users? > > I'm not entirely sure where you are in the decision making process > > right > > now

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-09 Thread Ralf Gommers
On Wed, Mar 4, 2020 at 1:22 AM Sebastian Berg wrote: > On Sun, 2020-02-23 at 22:44 -0800, Stephan Hoyer wrote: > > On Sun, Feb 23, 2020 at 3:59 PM Ralf Gommers > > wrote: > > > > > > On Sun, Feb 23, 2020 at 3:31 PM Stephan Hoyer > > > wrote: > > > > On Thu, Feb 6, 2020 at 12:20 PM Sebastian Ber

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-08 Thread Sebastian Berg
On Wed, 2020-04-08 at 17:04 -0400, Andreas Mueller wrote: > Hey all. > Is there any update on this? Is there any input we can provide as > users? > I'm not entirely sure where you are in the decision making process > right > now :) > Hey, thanks for the ping. Things are a bit stuck right now. I

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-04-08 Thread Andreas Mueller
Hey all. Is there any update on this? Is there any input we can provide as users? I'm not entirely sure where you are in the decision making process right now :) Cheers, Andy On 3/3/20 6:34 PM, Sebastian Berg wrote: On Fri, 2020-02-28 at 11:28 -0500, Allan Haldane wrote: On 2/23/20 6:59 PM,

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-03-03 Thread Sebastian Berg
On Sun, 2020-02-23 at 22:44 -0800, Stephan Hoyer wrote: > On Sun, Feb 23, 2020 at 3:59 PM Ralf Gommers > wrote: > > > > On Sun, Feb 23, 2020 at 3:31 PM Stephan Hoyer > > wrote: > > > On Thu, Feb 6, 2020 at 12:20 PM Sebastian Berg < > > > sebast...@sipsolutions.net> wrote: > > > > > > I don't t

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-03-03 Thread Sebastian Berg
On Fri, 2020-02-28 at 11:28 -0500, Allan Haldane wrote: > On 2/23/20 6:59 PM, Ralf Gommers wrote: > > One of the main rationales for the whole NEP, and the argument in > > multiple places > > ( > > https://numpy.org/neps/nep-0037-array-module.html#opt-in-vs-opt-out-for-users > > ) > > is that it's

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-28 Thread Allan Haldane
On 2/23/20 6:59 PM, Ralf Gommers wrote: > One of the main rationales for the whole NEP, and the argument in > multiple places > (https://numpy.org/neps/nep-0037-array-module.html#opt-in-vs-opt-out-for-users) > is that it's now opt-in while __array_function__ was opt-out. This isn't > really true -

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-27 Thread Sebastian Berg
On Sun, 2020-02-23 at 22:44 -0800, Stephan Hoyer wrote: > > > On Sun, Feb 23, 2020 at 3:59 PM Ralf Gommers > wrote: > > > Also, I'm still not sure I agree with the tone of the discussion on > > this topic. It's very heavily inspired by what the JAX devs are > > telling you (the NEP still says P

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-23 Thread Stephan Hoyer
On Sun, Feb 23, 2020 at 3:59 PM Ralf Gommers wrote: > > > On Sun, Feb 23, 2020 at 3:31 PM Stephan Hoyer wrote: > >> On Thu, Feb 6, 2020 at 12:20 PM Sebastian Berg < >> sebast...@sipsolutions.net> wrote: >> >>> >>> Another thing about backward compatibility: What is our vision there >>> actually?

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-23 Thread Ralf Gommers
On Sun, Feb 23, 2020 at 3:31 PM Stephan Hoyer wrote: > On Thu, Feb 6, 2020 at 12:20 PM Sebastian Berg > wrote: > >> >> Another thing about backward compatibility: What is our vision there >> actually? >> This NEP will *not* give the *end user* the option to opt-in! Here, >> opt-in is really rese

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-23 Thread Stephan Hoyer
On Thu, Feb 6, 2020 at 12:20 PM Sebastian Berg wrote: > > It is less clear how this could work for __array_module__, because > > __array_module__ and get_array_module() are not generic -- they > > refers explicitly to a NumPy like module. If we want to extend it to > > SciPy (for which I agree th

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-06 Thread Sebastian Berg
On Thu, 2020-02-06 at 09:35 -0800, Stephan Hoyer wrote: > On Wed, Feb 5, 2020 at 8:02 AM Andreas Mueller > wrote: > > > - We use scipy.linalg in many places, and we would need to do a > > separate dispatching to check whether we can use module.linalg > > instead > > (that might be an issue for

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-06 Thread Stephan Hoyer
On Wed, Feb 5, 2020 at 8:02 AM Andreas Mueller wrote: > A bit late to the NEP 37 party. > I just wanted to say that at least from my perspective it seems a great > solution that will help sklearn move towards more flexible compute engines. > I think one of the biggest issues is array creation (in

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-05 Thread Ralf Gommers
On Wed, Feb 5, 2020 at 12:14 PM Eric Wieser wrote: > > scipy.linalg is a superset of numpy.linalg > > This isn't completely accurate - numpy.linalg supports almost all > operations* over stacks of matrices via gufuncs, but scipy.linalg does not > appear to. > > Eric > > *: not lstsq due to an un

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-05 Thread Eric Wieser
> scipy.linalg is a superset of numpy.linalg This isn't completely accurate - numpy.linalg supports almost all operations* over stacks of matrices via gufuncs, but scipy.linalg does not appear to. Eric *: not lstsq due to an ungeneralizable public API On Wed, 5 Feb 2020 at 17:38, Ralf Gommers

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-05 Thread Ralf Gommers
On Wed, Feb 5, 2020 at 10:01 AM Andreas Mueller wrote: > A bit late to the NEP 37 party. > I just wanted to say that at least from my perspective it seems a great > solution that will help sklearn move towards more flexible compute engines. > I think one of the biggest issues is array creation (i

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-02-05 Thread Andreas Mueller
A bit late to the NEP 37 party. I just wanted to say that at least from my perspective it seems a great solution that will help sklearn move towards more flexible compute engines. I think one of the biggest issues is array creation (including random arrays), and that's handled quite nicely with

Re: [Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-01-08 Thread Sebastian Berg
Thanks, maybe to start discussion floating the actual usage here: ``` def add_noise(array_like): module = np.get_array_module(array_like) noise = module.random.randn(*array_like.shape) return array_like + noise ``` The above function could also include `module.asarray(array_like)` to

[Numpy-discussion] NEP 37: A dispatch protocol for NumPy-like modules

2020-01-06 Thread Stephan Hoyer
I am pleased to present a new NumPy Enhancement Proposal for discussion: "NEP-37: A dispatch protocol for NumPy-like modules." Feedback would be very welcome! The full text follows. The rendered proposal can also be found online at https://numpy.org/neps/nep-0037-array-module.html Best, Stephan H