Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP python bindings via pybind11 #1429

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

apoorvalal
Copy link

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

@erikcs
Copy link
Member

erikcs commented Jul 8, 2024

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

@apoorvalal apoorvalal marked this pull request as draft July 8, 2024 18:14
@apoorvalal
Copy link
Author

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

@erikcs
Copy link
Member

erikcs commented Nov 14, 2024

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)

@apoorvalal
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants