UKZN-Astronomy / corrcal

Python/C code for calibration of quasi-redundant arrays. Different (fixed) algorithm from original corrcal
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Which C extension module should we use? #8

Closed piyanatk closed 5 years ago

piyanatk commented 5 years ago

The current Python codes use both ctypesand cffi to interface with the C functions. These are two different C interfacing modules: ctypes is in the standard library, whereas cffi is a newer external module. I am not sure if they should be mixed as in the current codes, and cffi seems to be better(?) according to online discussion, so we may want to consider dropping ctypes for cffi. Another common option for working with C in Python is Cython, and there are many more (see here and here)

piyanatk commented 5 years ago

Upon inspecting the code, it looks like cffi was loaded but never used. Perhaps, @sievers was just looking into it?

ronniyjoseph commented 5 years ago

Sorry that was me! I was looking into CFFI as a modern alternative to interfacing with C, except I never got round to actually implementing it. I was planning on removing it.

piyanatk commented 5 years ago

I see! @ronniyjoseph , Is the current implementation with ctypes working?

ronniyjoseph commented 5 years ago

Yes, the current implementation with ctypes works. However, yes there might some merit to investigating alternate c-interfaces

piyanatk commented 5 years ago

I think for now we should stick with ctypes. Improving the C code should be postpone to our next milestone. I am going to close this for now. We will reopen it once revisited this issue.