GSOC Week 4

Strategy to automate R wrapper generation

This week, I focussed on finalizing the strategy to generate wrapper code using autowrap. It was exciting to discover that with some changes to the code, it might be possible to generate R code. So, we would be able to generate R wrapper code easily by using information from parsed pxd files.

  • The ConversionProvider module provides classes which facilitate conversion of input arguments from python to cpp type, provide information on using the arguments going forward and also enable cpp output conversion back to python.

  • In a similar manner, in ConversionProvider, we can either change the existing functions or provide new ones to manage conversion between python and R data types.

  • The CodeGenerator module is where all the code for generating cython wrapper resides. Here also, we can modify functions and change the function call flow appropriately generate R code instead.

  • The wrapping should be atleast done for data structures which are not nested. This is because, nested data structures constitute only a small portion of OpenMS.

  • It would also be beneficial to make use of autowrap declaratives (like # wrap-ignore, # wrap-as) for generating the wrappers. This would hugely simplify the whole wrapping process.

  • Limit generating wrappers for simpler processes first and later try for ones which use nested data structures.

Thus, another exciting week came to an end, with a fruitful discussion with mentors and very convincing findings.

Written on July 8, 2020