grf
grf copied to clipboard
WIP python bindings via pybind11
create bindings in python/ that uses pybind11 to wrap grf code. Developing with regression_forest as first end-to-end example. Progress documented in python/notebooks/scratch.ipynb
Very nice Apoorva, maybe you could convert this to a "Draft PR" then just use this as a playground for learning and fighting with C++/bindings using grf's build system at your own pace? I can happily give some input if you tally up questions. For a general scaffold I think anything James Yang does is awesome and looking for inspiration there is probably a good idea: https://github.com/JamesYang007/adelie
Thanks Erik! Yeah, that was the plan (i was using the low-fi solution of prefixing with Work in progress but draft PR works better).
I also spent some time re-building skgrf from scratch in cython and found it works fine now, btw; I might develop that in parallel since it is less daunting to have to juggle serialization / pointers etc on cython [all the wrapper code lives in one place in contrast to the pybind11 solution).
Will keep you posted
Is this still something you want to devote large chunk of time to? If not let's close this for now? (for users who don't want to leave python, stitching together ryp/rpy2 could perhaps be an easier alternative)
Since I started this, a new project that uses arrow to move between R/Py has popped up and is how I use grf now [example with mgcv]. Maybe a short notebook that demoes this workflow (via quarto) could be a useful addition to the docs?
That sounds like a great and practical idea! If you find it engaging, perhaps you could create an example gallery on your page to gather user feedback and refine the approach. (For contributions to the grf repo, we generally aim for the level of reliability seen in Eddelbuettel’s work. The ryp project, like many Python projects, might benefit from some additional bug-fixing to enhance its robustness.)
Closing in favor of #257 which discusses R/Python interop.