Home > OS >  Is it safe to use functions from numpy.core.*?
Is it safe to use functions from numpy.core.*?

Time:02-24

To motivate the question: In recent NumPy versions there is a performance issue with numpy.clip and in the corresponding issue a suggested workaround is to use numpy.core.umath.clip.

I couldn't really find anything about the purpose of the numpy.core.umath or more generally the numpy.core.* modules. pydoc shows documentation for them but they seem not to be included in the online documentation. Therefore I am a bit unsure if it is safe (in the sense of having a stable API) to use functions from these modules or if they should rather be seen as internals that may change between releases?

CodePudding user response:

The documentation of numpy.core states:

Please note that this module is private. All functions and objects are available in the main numpy namespace - use that instead.

This submodule is apparently not meant to be used by end-users. This is also why there is almost no online documentation about it. The functions in this submodule are more likely to change in the future than the regular ones in provided in numpy.

  • Related