BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Functions | |
std::unique_ptr< MultiLayer > | createFromPython (const std::string &script, const std::string &functionName, const std::string &path="") |
std::vector< std::string > | listOfFunctions (const std::string &script, const std::string &path="") |
std::unique_ptr< MultiLayer > PyImport::createFromPython | ( | const std::string & | script, |
const std::string & | functionName, | ||
const std::string & | path = "" |
||
) |
Creates a multi layer by running python code in embedded interpreter.
script | Python script |
functionName | A function name in this script which produces a MultiLayer |
path | A path to import BornAgain library. If empty, relies on PYTHONPATH |
Definition at line 35 of file PyImport.cpp.
References MultiLayer::clone(), anonymous_namespace{PyImport.cpp}::error_description(), and PyEmbeddedUtils::import_bornagain().
std::vector< std::string > PyImport::listOfFunctions | ( | const std::string & | script, |
const std::string & | path = "" |
||
) |
Returns list of functions defined in the script.
script | Python script |
path | A path to import BornAgain library. If empty, relies on PYTHONPATH |
Definition at line 87 of file PyImport.cpp.
References anonymous_namespace{PyImport.cpp}::error_description(), PyEmbeddedUtils::import_bornagain(), and PyEmbeddedUtils::toString().