Skip to content
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

[BUG]: Docstring Types for Numpy/Eigen Matricies #5211

Open
3 tasks done
InvincibleRMC opened this issue Jun 29, 2024 · 0 comments
Open
3 tasks done

[BUG]: Docstring Types for Numpy/Eigen Matricies #5211

InvincibleRMC opened this issue Jun 29, 2024 · 0 comments
Labels
triage New bug, unverified

Comments

@InvincibleRMC
Copy link
Contributor

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

51c2aa1

Problem description

Hello there. The generated docstring for eigen tensors things look like the following numpy.ndarray[numpy.float64[3,2]]. I was curious why this was decided since this is not valid Python typing. It should be something like numpy.typing.NDArray[numpy.float64]. I assume the [3, 2] are supposed to be suggesting shape information but, that is still not supported numpy/numpy#16544. The generated syntax causes stubgen to crash. I'm fine fixing it I just wanted more information on what exactly was going on here.

Reproducible example code

Running mypy stubgen on the test cases.

stubgen -p pybind11_tests.eigen_tensor

Is this a regression? Put the last known working version here if it is.

Not a regression

@InvincibleRMC InvincibleRMC added the triage New bug, unverified label Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New bug, unverified
Projects
None yet
Development

No branches or pull requests

1 participant