-
Notifications
You must be signed in to change notification settings - Fork 214
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
ctypes and cffi? #211
Comments
Hi @paugier, thanks for the link! I hadn't seen that post. Basically, I didn't really know about CFFI until recently. I've been having a good experience with ctypes and numpy arrays have builtin support for it. Right now, I don't know if it's worth the trouble of switching if ctypes is working. But I'm open to suggestions if there is anything specific that CFFI can address. Thanks for taking the time to give feedback! I really appreciate it. |
Can we close this 2.5-year-old issue? I don't think we will switch to cffi in the next few years. |
Yep, close it as wontfix. But feel free to reopen if someone wants to work on it 🙂 |
Just tried cffi. The following example shows how to call the API function >>> from cffi import FFI
>>> ffi = FFI()
>>> ffi.cdef("int GMT_Get_Enum (void *V_API, char *key);")
>>> lib = ffi.dlopen("libgmt.dylib")
>>> lib.GMT_Get_Enum(ffi.NULL, b"GMT_VF_LEN")
32 For comparison, the ctypes version is Lines 263 to 280 in 5014591
|
It is just a small and fast question. I see in the documentation: "Interface with the GMT C API directly using ctypes (no system calls)."
I understood that now, cffi was just better than ctypes for new projects (see for example https://www.quora.com/How-can-I-decide-between-using-ctypes-and-CFFI-in-Python).
I was wondering if there is a reason why gmt-python doesn't use cffi instead of ctypes?
The text was updated successfully, but these errors were encountered: