-
Notifications
You must be signed in to change notification settings - Fork 58
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
More thoroughly type *Handle
classes
#501
base: branch-24.12
Are you sure you want to change the base?
Conversation
0e78416
to
0643403
Compare
c4bbe93
to
6e1d3b7
Compare
6e1d3b7
to
33c4290
Compare
RemoteHandle
*Handle
classes
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.
I am not sure it is a good idea to expose the Cython API. Currently, all of _lib
is private and is exposed and documented in kvikio
explicitly.
If we go down this route, we should replace all of kvikio
with _lib
, and add .pyi
files and docstrings.
I guess it depends on whether we expect anyone to use the Cython API? Currently, people either use the Python API or the C++ API.
There is At a first pass was thinking about internal usage and simply making that experience better If we don't ship the It is possible this could be useful externally. For example could imagine a performant Zarr implementation in Cython might use this |
True, we have cdef functions that takes
Right, but I really like to have the external and class declarations close together. If we only use something in one place, it is nice to have it together in a single file IMO.
I suspect that the overhead of calling a Python vs. a Cython function is negligible at this level but it might avoid a GIL grab. I think we should wait until this becomes an issue. |
Ok so is your main recommendation to fold the Are there other things I should consider when doing a second pass? |
Yes
I also prefer |
Ok can look at that The |
IMO, having I get why it is faster with |
*Handle
classes as much as possible.pxd
files for*Handle
objectscpdef
where appropriatePy_ssize_t
and use-1
or0
for default valuesparse_buffer_argument
asarray
on the Python side to ensure we haveArray
s in Cython to speedup access