← Back to team overview

yade-dev team mailing list archive

Re: better python wrapping

 

Anton Gladky napsal(a):
I have a small problem with that.

I want to add this macros to my Law2_Dem3DofGeom_RockPMPhys_Rpm
But I do not have there no variables, which can be described.

What syntax should be?

This one is not working,

YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(Law2_Dem3DofGeom_RockPMPhys_Rpm,LawFunctor,"Constitutive law for the Rpm model",
        (),
        /*ctor*/,/*py*/);

Should work if you don't put anything between the commas, like

YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(Law2_Dem3DofGeom_RockPMPhys_Rpm,LawFunctor,"Constitutive law for the Rpm model",,,);

(BTW you don't need the _PY part, that just adds the last argument, so you can then write

YADE_CLASS_BASE_DOC_ATTRDECL_CTOR(Law2_Dem3DofGeom_RockPMPhys_Rpm,LawFunctor,"Constitutive law for the Rpm model",,);

)

Cheers, v.



Follow ups

References