BornAgain
1.19.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="") |
Creates a multi layer by running python code in embedded interpreter. More... | |
std::vector< std::string > | listOfFunctions (const std::string &script, const std::string &path="") |
Returns list of functions defined in the script. More... | |
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 34 of file PyImport.cpp.
References MultiLayer::clone(), and PyUtils::import_bornagain().
Referenced by PyImportAssistant::createMultiLayer().
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 86 of file PyImport.cpp.
References PyUtils::import_bornagain(), and PyUtils::toString().
Referenced by PyImportAssistant::getPySampleFunctionName().