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

[C++] [Python] expose C++ class/struct data members to Python (for objects already exposed to Python) #138

Closed
suntzu86 opened this issue Jun 4, 2014 · 0 comments · Fixed by #425

Comments

@suntzu86
Copy link
Contributor

suntzu86 commented Jun 4, 2014

Some C++ classes like GradientDescentParameters (and other parameter struts, gaussian process, etc) are exposed directly to Python (i.e., we expose a constructor so python can build objects & pass them back thru the interface).

These classes' data members and getters/setters can be accessed from Python directly:
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/python/exposing.html#python.class_data_members

I'm undecided on whether all members should be marked readonly from Python even if they're modifiable in the C++ object. At least for parameter structs, it probably makes sense to allow mutability (so you dont have to remake an object to modify 1 value).

Either way, this will make it a lot easier to test through the interface, e.g., as mentioned in:
GH-97
GH-106

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

Successfully merging a pull request may close this issue.

1 participant