[Numpy-discussion] Proposal to accept NEP-18, array_function protocol (original) (raw)

Matthew Brett matthew.brett at gmail.com
Wed Aug 15 12:44:00 EDT 2018


Hi,

On Wed, Aug 15, 2018 at 5:36 PM, Hameer Abbasi <einstein.edison at gmail.com> wrote:

On 15. Aug 2018, at 18:25, Matthew Brett <matthew.brett at gmail.com> wrote:

Hi, Thanks Nathaniel for this thoughtful response. On Mon, Aug 13, 2018 at 10:44 AM, Nathaniel Smith <njs at pobox.com> wrote: ... The other approach would be to incrementally add clean, well-defined dunder methods like arrayufunc, arrayconcatenate, etc. This way we end up putting some thought into each interface, making sure that it's something we can support, protecting downstream libraries from unnecessary complexity (e.g. they can implement arrayconcatenate instead of hstack, vstack, rowstack, columnstack, ...), or avoiding adding new APIs entirely (e.g., by converting existing functions into ufuncs so arrayufunc starts automagically working). And in the end we get a clean list of dunder methods that new array container implementations have to define. It's plausible to imagine a generic test suite for array containers. (I suspect that every library that tries to implement arrayfunction will end up with accidental behavioral differences, just because the numpy API is so vast and contains so many corner cases.) So the clean-well-defined-dunders approach has lots of upsides. The big downside is that this is a much longer road to go down.

Does everyone agree that, if we had infinite time and resources, this would be the better solution? More resources means (given NumPy’s consensus system), more people have to agree on the overall design, so in my mind, it might even be slower.

I don't think that's likely. As far as I can see, past discussions have been slow because several people need to get deep down into the details in order to understand the problem, and then stay focused through the discussion. When there is no-one working on that full-time, it's easy for the discussion to drift into the background, and the shared understanding is lost. My suspicion is, to the extent that Matti and Tyler can devote time and energy to shepherding the discussion, these will become quicker and more productive.

Cheers,

Matthew



More information about the NumPy-Discussion mailing list