pnumpy icon indicating copy to clipboard operation
pnumpy copied to clipboard

are we allowed to add new functionality like "isnotnan"

Open tdimitri opened this issue 5 years ago • 3 comments

users often call "~np.isnan(arr)" this makes TWO passes and produces a temporary array in the process. Are we allowed to add "isnotnan" then the user can call np.isnotnan(arr).

For instance let's say the final module name is "pnumpy" for parallel numpy.

import pnumpy as pn
pn.isnotnan(arr)

is this project allowed to add new routines like isnotnan that the core numpy code may eventually take?

tdimitri avatar Sep 29 '20 13:09 tdimitri

This is up to the project. We should likely not do that too often, but if it is justified and we believe a case could be made to the NumPy community that they should accept the new function into NumPy, then I don't see why not.

teoliphant avatar Oct 08 '20 05:10 teoliphant

NumPy is only likely to accept new functionality that matches the array api spec.

mattip avatar Dec 15 '20 14:12 mattip

I would suggest adding new functionality like this, which I think is in accordance with NEP 36:

  • Add the functions in a separate namespace like pnumpy._numpy_extended so we can clearly document them as extensions
  • If we wish to upstream them to numpy, file an issue that clearly explains the use case and suggests the API used

mattip avatar Dec 16 '20 07:12 mattip