[Numpy-discussion] Proposal to accept NEP-18, __array_function__ protocol

Allan, Daniel dallan at bnl.gov
Wed Aug 29 11:02:42 EDT 2018


> Well, I guess I'll be proving Nathaniel right: I would *definitely* start using __array_function__ in astropy - not being able to concatenate Quantity and other instances which use it has been a long-standing pain.

That's fair enough, but I think Matt's point still stands. Any given project can weigh the benefits of early adoption against the risks, considering its need for a new feature and its resources available to deal with possible future changes. An "Experimental" designation gives numpy a little space to innovate and lets individual projects opt in. Without that space, numpy has to take on all the burden of continuity instead of sharing that burden with the community of projects that opt in to early adoption.

Best,
Dan


Daniel B. Allan, Ph.D
Associate Computational Scientist, Brookhaven National Lab
(631) 344-3281 (no voicemail set up)
________________________________
From: NumPy-Discussion <numpy-discussion-bounces+dallan=bnl.gov at python.org> on behalf of Marten van Kerkwijk <m.h.vankerkwijk at gmail.com>
Sent: Wednesday, August 29, 2018 10:43:55 AM
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Proposal to accept NEP-18, __array_function__ protocol

On Wed, Aug 29, 2018 at 9:53 AM Matthew Rocklin <mrocklin at gmail.com<mailto:mrocklin at gmail.com>> wrote:
> On the backwards compatibility: from an astropy perspective, I would expect that the introduction of `__array_function__` implies a guarantee that the *functionality* it provides will remain,

My guess is that you wouldn't have this expectation if Numpy released this feature with explicit "Experimental" warnings  attached to it.   In that case astropy might just wait before adopting it until that label was dropped.  Projects that were more risk-friendly would then take on the burden of trying it out, working out some kinks, and then hopefully in a version or two the "Experimental" label would be dropped and astropy would step in and adopt it more safely.

Well, I guess I'll be proving Nathaniel right: I would *definitely* start using __array_function__ in astropy - not being able to concatenate Quantity and other instances which use it has been a long-standing pain.

I do think that even for an experimental feature one should be allowed to expect that there will continue to be a way provided by numpy to access the same functionality, i.e., once we allow people to do `np.concatenate(list-of-mimics)`, I think we should consider ourselves committed to providing some way to continue doing that -  the experimental tag should only imply that we are not committed to the precise method with which that can be achieved. (Of course, I can be a bit more cavalier than most, since I am hopeful I can help ensure that some method will continue to be present; indeed, the same happened for __array_ufunc__ - I had already written a __numpy_ufunc__ implementation in Quantity and when that stalled in numpy, I picked up and finished the __array_ufunc__ code that Nathan had written.)

-- Marten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180829/617081d6/attachment.html>


More information about the NumPy-Discussion mailing list