-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Functions in numpy.random
have no signature (in the sense of inspect.signature
)
#21908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It works on python functions, and fails on Cython functions. |
Add binding so that inspect will work correctly closes numpy#21908
See Cython documentation on directives for informatio as to why these don't work. |
Do you mean before or after commit ENH: Add binding for random pyx files ? |
They work after setting binding to True. Currently binding is not set so False. Setting them to true isn't totally straight forward since this option produces some unused functions which blocks CI. |
Add binding so that inspect will work correctly closes numpy#21908
Add binding so that inspect will work correctly closes numpy#21908
Describe the issue:
While writing bindings for Numpy I discovered that functions in
numpy.random
aremissing signatures (in the sense of
inspect.signature
).My use case: I am using function signatures to automatically generate Racket bindings for large parts of Numpy.
The following output were generated by the script
signature-random.py
.Functions where inspect.signature fails
Functions where inspect.signature works
__RandomState_ctor
Builtins (where inspect.signature fails)
beta
binomial
bytes
chisquare
choice
default_rng
dirichlet
exponential
f
gamma
geometric
get_state
gumbel
hypergeometric
laplace
logistic
lognormal
logseries
multinomial
multivariate_normal
negative_binomial
noncentral_chisquare
noncentral_f
normal
pareto
permutation
poisson
power
rand
randint
randn
random
random_integers
random_sample
ranf
rayleigh
sample
seed
set_state
shuffle
standard_cauchy
standard_exponential
standard_gamma
standard_normal
standard_t
triangular
uniform
vonmises
wald
weibull
zipf
Reproduce the code example:
Error message:
No response
NumPy/Python version information:
The text was updated successfully, but these errors were encountered: