You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking for def sin and other such functions in typing/numpy.py, and they're missing completely. It's unclear why.
The actual question I was trying to figure out is: how often is the dtype keyword used for unary ufuncs. I thought the data I needed would be here, but it looks like it's not.
Does this have to do with the Python-C bridge? Meaning, I am not sure that the tooling currently picks up C-level argument handling, which could be applicable for ufuncs.
Since ufuncs are a custom object, not just a function, we record them as such. If you then look at the same file, you will see a class ufunc which has the overloads for all the calls:
So it is currently showing the number of times each ufunc is retrieved from the ufunc module (the first stats) and then also how ufuncs are called generally (the second stats).
We could also show the product of these, showing per ufunc instance how it's called.
Currently, ufuncs all show up as defined in the numpy module, because it's hard to find where they were defined (#70)
In numpy/numpy#29675 this subject came up in connection with the where kwarg. I see it is used in class ufunc (rarely). So that is for all ufuncs together, right?
Is there a way to figure out which ufunc is actually being used?
Activity
kgryte commentedon Feb 4, 2021
Does this have to do with the Python-C bridge? Meaning, I am not sure that the tooling currently picks up C-level argument handling, which could be applicable for
ufuncs.rgommers commentedon Feb 4, 2021
Ah yes, that's it (unfortunately). Pretty much all functions that are not ufuncs have a thin Python shim and will be picked up, ufuncs aren't.
saulshanabrook commentedon Apr 5, 2021
The ufunc data is available, see in the file you referenced:
Since ufuncs are a custom object, not just a function, we record them as such. If you then look at the same file, you will see a
class ufuncwhich has the overloads for all the calls:So it is currently showing the number of times each ufunc is retrieved from the ufunc module (the first stats) and then also how ufuncs are called generally (the second stats).
We could also show the product of these, showing per ufunc instance how it's called.
Currently, ufuncs all show up as defined in the
numpymodule, because it's hard to find where they were defined (#70)mattip commentedon Sep 5, 2025
In numpy/numpy#29675 this subject came up in connection with the
wherekwarg. I see it is used inclass ufunc(rarely). So that is for all ufuncs together, right?with a lot of hits. That looks like a static typing call, and not an actual code usage, correct?
The actual subject of this issue "ufunc data seems to be missing" has been answered, can the issue be closed?