Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use NumPy 1.7 API for pybind11#59

Merged
pschella merged 1 commit into
masterndarray/ndarray:masterfrom
pybind11ndarray/ndarray:pybind11Copy head branch name to clipboard
Jul 18, 2017
Merged

Use NumPy 1.7 API for pybind11#59
pschella merged 1 commit into
masterndarray/ndarray:masterfrom
pybind11ndarray/ndarray:pybind11Copy head branch name to clipboard

Conversation

@pschella

Copy link
Copy Markdown

No description provided.

Comment thread include/ndarray/converter/ufunctors.h Outdated
PyObject* input_array = PyArray_FROM_OTF(input,detail::NumpyTraits<TArgument>::getCode(),
NPY_ALIGNED);
PyArrayObject* input_array = PyArray_FROM_OTF(input,detail::NumpyTraits<TArgument>::getCode(),
NPY_ARRAY_ALIGNED);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reindent second line, please.

Comment thread include/ndarray/converter/eigen.h Outdated
// check whether the size is correct if it's static
if (N == 2) {
if (Rows_ != Eigen::Dynamic && PyArray_DIM(p.get(), 0) != Rows_) {
if (Rows_ != Eigen::Dynamic && PyArray_DIM(reinterpret_cast<PyArrayObject*>(p.get()), 0) != Rows_) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it'd be good to use a temporary PyArrayObject* variable here, too.

@TallJimbo

Copy link
Copy Markdown
Member

If the user does not define NPY_NO_DEPRECATED_API before importing the NumPy headers, do they just get a warning (but everything works?)

If so, maybe the best way to handle this is to put a #ifndef NPY_NO_DEPRECATED_API block in one of these headers with another warning that tells the user that ndarray is NumPy 1.7-friendly and they can disable both warnings by adding that define. I don't think we have much choice but to add that #define to all of the LSST code using NumPy.

Ultimately, I'd still like to switch all of this code to use the pybind11 NumPy API directly and avoid all the NumPy imports, but that's a much bigger change that will require extensive testing and probably adding some things upstream in pybind11.

@pschella

Copy link
Copy Markdown
Author

Yes, that is the case. I added a warning as requested.

@pschella pschella merged commit d6c2858 into master Jul 18, 2017
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.