Hi,
I've already built a simple Python class wrapper generator.
Please check the implementation:
Using this wrapper generator, I've already made a simple matplotlib wrapper:
the wrapper I've already built allows us to make simple class wrapper by only these lines:
class Matplotlib
class Axes
include PyCall::PyObjectWrapper
wrap_class PyCall.import_module('matplotlib.axes').Axes
end
end
This class wrapper builder can only wrap class and instance methods as is.
So we need to use PyCall.tuple to make a tuple that is passed to a wrapped function if the function requires an argument is a tuple.
Numpy's reshape method is good example to see it.
Let x is numpy's ndarray object. x.reshape requires a tuple parameter.
We need to write it in Ruby with pycall:
x.reshape(PyCall.tuple(1, 2))
I think most Rubyists think that they want to write:
x.reshape([1, 2])
PyCall doesn't convert a Ruby array to a Python tuple, so we need handwrite special wrapper methods for Numpy's reshape.
# Note that the current implementation of pycall is in very experimental state.
# So the implementation can be dramatically changed when you start your GSOC project.
I think that the most works of building bridge libraries are designing the best interfaces for Rubyists.
If you want to build bridge libraries for machine learning like scikit-learn, you must design the bridge library to provide natural interface for Rubyists rather than Pythonista.
So, if you want to build scikit-learn bridge, you should have at least the following skills.
- You should know what is natural as a Ruby program for mature Rubyists
- Practical (not exercise) programming experiences of scikit-learn
- Deep knowledge of scikit-learn internals
- Knowledge of machine learning algorithms implemented in scikit-learn for testing bridge library
(If you want to build pandas bridge, please do s/scikit-learn/pandas/g)
Do you have these skills?
In addition, you need to find other mentor(s) for you if you live in outside of Japan.
I'm very sorry that this year I cannot become mentor for students from outside of Japan.
The reason is that I have one-year-old child, so I cannot work from 6pm to 10am in JST (from 10am to 1am UTC) in weekdays and all weekends.