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

Redo numpy.pxd changes and update tests #3365

Merged
merged 1 commit into from Feb 19, 2020
Merged

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Feb 18, 2020

xref gh-2498 (enables closing it?)
reverts gh-3114 which reverted gh-3095 (since the first version of the @property decorator was not complete)

Use the new @property decorator to support converting numpy python code like ndarray.shape[0] to PyArray_DIMS(ndarray)[0]. Now running CFLAGS=-Wall python runtests.py numpy produces no warnings.

Also removed the unneeded numpy_common.pxi: numpy headers have apparently been cleaned up and no longer warn.

To make sure, I used this version via pip install . to build scipy which succeeded. Scipy still warns, once cython3.0 is released I can update the code in scipy to use ('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')

@mattip
Copy link
Contributor Author

mattip commented Feb 19, 2020

All checks are passing

@scoder scoder added this to the 3.0 milestone Feb 19, 2020
@scoder scoder added the Library label Feb 19, 2020
dtype descr # deprecated since NumPy 1.7 !
PyObject* base

@property
cdef int ndim(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering, but do you think it would help to declare these inline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe. I would have to look at the C-code from a real usage to see how much overhead would be removed

@scoder scoder merged commit 3a7fafd into cython:master Feb 19, 2020
@scoder
Copy link
Contributor

scoder commented Feb 19, 2020

Lovely! :)

@mattip
Copy link
Contributor Author

mattip commented Feb 19, 2020

Thanks!

@mattip mattip deleted the numpy-old branch May 30, 2021 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants