dib-lab / kProcessor

kProcessor: kmers processing framework.
https://kprocessor.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Python Wrapper for multicolumn dataframe #30

Open shokrof opened 5 years ago

shokrof commented 5 years ago

I finished the implementation of multicolumn Kdataframe. Please make python interface for these functions in the kDataframe class: template void addColumn(string columnName);

template T getKmerColumnValue(string columnName,string kmer);

template void setKmerColumnValue(string columnName,string kmer, T value);

As far as I remember, SWIG allows you to wrap template functions by defining new functions for each datatype. I suggest you make functions for these datatypes: int, float, and bool.

Please work on kDataframeMultiColumn branch.

mr-eyes commented 5 years ago

SWIG requires to wrap all possible types in the template function.

So, if the function accepts all types of numbers like floats, doubles, integers.

and the template function is

template<typename T>
void foo(T number);

SWIG will require to wrap

void foo(int number)
void foo(double number)
void foo(float number)

So, kindly provide me all the possible data types to wrap each one of them.

Thanks.

ctb commented 5 years ago

might look into:

http://www.camillescott.org/2019/04/11/cmake-cppyy/

instead of SWIG.

mr-eyes commented 5 years ago

@ctb Camille's solution seems to be very handy. however, we are using SWIG for now cause it's very easy to write and time-saving to create the bindings just to make sure everything is working as expected. It will also allow us to create bindings to other languages like R.

After the beta release of the software, we will certainly consider using the very promising cppyy.

shokrof commented 5 years ago

@mr-eyes start with int, float, and bool.