Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Nathan Goldbaum
Oh wait, since the decorated version of the ufunc will be the one in the public numpy API it won't break. It would only break if the callable that was passed in *wasn't* the decorated version, so it kinda *has* to pass in the decorated function to preserve backward compatibility. Apologies for the

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Nathan Goldbaum
Hmm, does this mean the callable that gets passed into __array_ufunc__ will change? I'm pretty sure that will break the dispatch mechanism I'm using in my __array_ufunc__ implementation, which directly checks whether the callable is in one of several tuples of functions that have different behavior

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Marten van Kerkwijk
Yes, the function should definitely be the same as what the user called - i.e., the decorated function. I'm only wondering if it would also be possible to have access to the undecorated one (via `coerce` or `ndarray.__array_function__` or otherwise). -- Marten __

[Numpy-discussion] 2018 John Hunter Excellence in Plotting Contest

2018-06-05 Thread Nelle Varoquaux
Hello everyone, Sorry about the cross-posting. There's a couple more days to submit to the John Hunter Excellence in Plotting Competition! If you have any scientific plot worth sharing, submit an entry before June 8th. For more information, see below. Thanks, Nelle In memory of John Hunter, we

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Stephan Hoyer
On Tue, Jun 5, 2018 at 2:47 PM Matti Picus wrote: > What is the difference between the `func` provided as the first argument > to `__array_function__` and `__array_ufunc__` and the "non-overloaded > version of the provided function"? > The ""non-overloaded version of the provided function" is en

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Matti Picus
On 05/06/18 14:11, Stephan Hoyer wrote: On Tue, Jun 5, 2018 at 12:35 PM Marten van Kerkwijk mailto:m.h.vankerkw...@gmail.com>> wrote: Things would, I think, make much more sense if `ndarray.__array_ufunc__` (or `*_function__`) actually *were* the implementation for array-only. But

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Marten van Kerkwijk
Hi Stephan, On `NotImplementedButCoercible`: don't forget that even a preliminary implementation of `__array_function__` has always the choice of coercing its own instances to ndarray and re-calling the function; that is really no different from (though probably a bit slower than) what would happe

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Stephan Hoyer
On Tue, Jun 5, 2018 at 12:35 PM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > Things would, I think, make much more sense if `ndarray.__array_ufunc__` > (or `*_function__`) actually *were* the implementation for array-only. But > while that is something I'd like to eventually get to, i

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Marten van Kerkwijk
Hi Stephan, Things would, I think, make much more sense if `ndarray.__array_ufunc__` (or `*_function__`) actually *were* the implementation for array-only. But while that is something I'd like to eventually get to, it seems out of scope for the current discussion. But we should be sure that the nd

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Stephan Hoyer
On Mon, Jun 4, 2018 at 7:35 AM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > Hi Stephan, > > Another potential consideration in favor of NotImplementedButCoercible is >> for subclassing: we could use it to write the default implementations of >> ndarray.__array_ufunc__ and ndarray.__ar

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-05 Thread Stephan Hoyer
On Mon, Jun 4, 2018 at 5:39 AM Matthew Harrigan wrote: > Should there be discussion of typing (pep-484) or abstract base classes in > this nep? Are there any requirements on the result returned by > __array_function__? > This is a good question that should be addressed in the NEP. Currently, we

[Numpy-discussion] NumPy 1.14.4 release

2018-06-05 Thread Charles R Harris
Hi All, The release notes for the NumPy 1.14.4 release are up. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion