Open nikohansen opened 9 years ago
This is because there's no constructor for CMAParametersPB
for the Python object (nor is there for CMAParametersNB
, etc...), and thus no custom __init__
function. The current reason for this is that at least one of the useful constructors in C++ requires a C++ vector of double. Boost python supports binding C++ to Python constructors but I couldn't find how pass non basic types such as vectors. My current understanding is that these types need to be transformed into Python types (such as C++ vector to Python array), and this is what make_parameters_pwqb
, make_simple_parameters
and other methods do.
So in summary, the constructor for CMAParameterPB
is make_parameters_pwqb
at the moment.
I am not happy with the current solution, and I have been looking at it one more time briefly, but I don't yet see how to do this simply on the Boost python side.
Maybe in pure Python on top of the lcmaes
module ?
I agree, it shouldn't be too difficult to rebuild the desired interface in Python instead.
I believe a pure Python slight encapsulation of CMAParameter class could take place in the lcmaes_interface of #125, once accepted.
For example,
yields
which is not particularly helpful to find out how to instantiate the
CMAParametersPB
class. At the moment I don't see a way how I could figure this out within Python.