Tomographer  v5.4
Tomographer C++ Framework Documentation
tpy::PyMHWalkerParamsToDict< MHWalkerParams > Struct Template Reference

C++ utility to convert a Python dictionary of fields into a valid C++ MHWalkerParams object. More...

#include <py/cxx/tomographerpy/pymhrw.h>

Static Public Member Functions

static py::dict makeDict (const MHWalkerParams &)
 
static MHWalkerParams fromPyObj (py::object)
 

Detailed Description

template<typename MHWalkerParams>
struct tpy::PyMHWalkerParamsToDict< MHWalkerParams >

C++ utility to convert a Python dictionary of fields into a valid C++ MHWalkerParams object.

Different MHWalker Interface may require different types of parameters. In C++, this is a template parameter which is passed on to whoever cares about those parameters. In python, the parameters are stored simply as an aribtrary dictionary of parameter values.

Specialize this template class to each C++ MHWalkerParams type so that it can be easily converted to/from a Python dictionary. In the conversion from Python, we actually allow the user to specify any object; this allows us to handle the case where they directly specify the step-size as a float instead of the explicit dictionary {'step_size': ...}.

Definition at line 63 of file pymhrw.h.


The documentation for this struct was generated from the following file: