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

Improve py::array_t scalar type information #724

Merged
merged 3 commits into from
Mar 13, 2017

Conversation

dean0x7d
Copy link
Member

@dean0x7d dean0x7d commented Mar 13, 2017

Resolves #632 and the comment in #631 (comment).

Before:

TypeError: incompatible function arguments. The following argument types are supported:
    1. (in: numpy.ndarray[float]) -> object
    2. (in: numpy.ndarray[float]) -> object
    3. (in: numpy.ndarray[complex]) -> object
    4. (in: numpy.ndarray[complex]) -> object

After:

TypeError: incompatible function arguments. The following argument types are supported:
    1. (in: numpy.ndarray[float32]) -> object
    2. (in: numpy.ndarray[float64]) -> object
    3. (in: numpy.ndarray[complex64]) -> object
    4. (in: numpy.ndarray[complex128]) -> object

@dean0x7d dean0x7d changed the title Add value_type member alias to py::array_t (resolve #632) Improve py::array_t scalar type information Mar 13, 2017
@dean0x7d
Copy link
Member Author

Updated to also improve the signatures of py::array_t functions. See #631 (comment). Having both float and double reported as float is confusing. Using npy_format_descriptor makes those float32 and float64. This is already the case for Eigen types so I don't think it should be an issue.

@dean0x7d dean0x7d merged commit 16afbce into pybind:master Mar 13, 2017
@dean0x7d dean0x7d deleted the value_type branch March 14, 2017 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants