-
Notifications
You must be signed in to change notification settings - Fork 34
Add consts to PyUFuncGenericFunction declarations #99
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
Conversation
efiring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, good idea.
https://numpy.org/doc/stable/reference/c-api/ufunc.html#c.PyUFuncGenericFunction shows the order as int const *x rather than the presumably equivalent const int *x. Is there a reason you chose the second form rather than matching the docs and ufuncobject.h?
|
No reason. It is indeed probably better to be consistent, I will switch it. |
|
Should I squash commits? |
|
I just used the "squash and merge" option of the merge button... |
GSW patch: TEOS-10/GSW-Python#99 galpy patch: jobovy/galpy#499 pyerfa patch: liberfa/pyerfa#89 astropy patch: astropy/astropy#13586 scipy patch: scipy/scipy#16924
This replaces TEOS-10#99 by putting the change in the code generator, not just in the generated code.
|
It turns out this was missing a critical element: the change in the code generator, tools/make_ufuncs.py. |
PyUFuncGenericFunctionhas typevoid (*)(char **, const npy_intp *, const npy_intp *, void *), sodimensionsandstepsshould be const. Otherwise compiling with-Wincompatible-function-pointer-typeswill fail:https://app.circleci.com/pipelines/github/hoodmane/pyodide/3783/workflows/3c5fdd0d-baf9-41b7-8dc8-56511ba2fdc0/jobs/45949