-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC/ENH: Tutorial for adding C functions #20733
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
Comments
Thanks for the suggestion - I think this is a good idea and will bring it to the next Documentation Team meeting. You are also welcome to join in case it interests you. Meetings happen every two weeks, and the next one will take place on Monday January 17 (I usually announce those on the mailing list). |
@melissawm I was unable to attend the meeting. Is there anything relevant that I missed? |
No, @madphysicist just general agreement that this would be nice. If anyone feels like taking this up, we'd be happy to review :) |
@melissawm. I'd be happy to get something started as I practice doing it myself, along the lines of the ufunc tutorial. There will be much missing and incorrect, but hopefully easy to fix. My only concern is that I don't really know where to start. Right now I'm piecing together what I can from |
Proposed new feature or change:
There is a good tutorial for writing ufuncs in C here: https://numpy.org/doc/stable/user/c-info.ufunc-tutorial.html. It would be wonderful if there was something similar for regular functions. I wouldn't have to bug devs so much if it existed.
Some specific questions that I'd like to have authoritative answers for:
Actual usecase #1: I wrote a ufunc based on the tutorial: https://github.com/madphysicist/is_integer_ufunc. Now I want to add some arguments, but since ufuncs can't accept arbitrary arguments, I have to turn my ufunc into an ordinary function, but with multiple loops.
Actual usecase #2: I'd like to write up an O(n) version of weighted partitioning/quantiles. This will look something similar to
sort
, which is a regular function.The text was updated successfully, but these errors were encountered: