Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
This repository was archived by the owner on May 13, 2025. It is now read-only.

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

@suntzu86

Description

@suntzu86

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions