BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Functions | |
PyObject * | createNumpyArray (const std::vector< double > &data) |
PyObject * | import_bornagain (const std::vector< std::string > &paths={}) |
Imports BornAgain from given location. If path is empty, tries to rely on PYTHONPATH. More... | |
std::string | pythonRuntimeInfo () |
Returns multi-line string representing PATH, PYTHONPATH, sys.path and other info. More... | |
std::string | pythonStackTrace () |
Returns string representing python stack trace. More... | |
std::string | toString (char *c) |
Converts char to string. In the case of nullptr will return an empty string. More... | |
std::string | toString (PyObject *obj) |
Converts PyObject into string, if possible, or throws exception. More... | |
std::string | toString (wchar_t *c) |
std::vector< std::string > | toVectorString (PyObject *obj) |
Converts PyObject into vector of strings, if possible, or throws exception. More... | |
PyObject * BaseUtils::Python::createNumpyArray | ( | const std::vector< double > & | data | ) |
Definition at line 178 of file PyUtils.cpp.
PyObject * BaseUtils::Python::import_bornagain | ( | const std::vector< std::string > & | paths = {} | ) |
Imports BornAgain from given location. If path is empty, tries to rely on PYTHONPATH.
Definition at line 71 of file PyUtils.cpp.
Referenced by Py::Import::createFromPython(), and Py::Import::listOfFunctions().
std::string BaseUtils::Python::pythonRuntimeInfo | ( | ) |
Returns multi-line string representing PATH, PYTHONPATH, sys.path and other info.
Definition at line 105 of file PyUtils.cpp.
References BaseUtils::System::getenv(), toString(), and toVectorString().
Referenced by pythonStackTrace().
std::string BaseUtils::Python::pythonStackTrace | ( | ) |
Returns string representing python stack trace.
Definition at line 138 of file PyUtils.cpp.
References pythonRuntimeInfo().
std::string BaseUtils::Python::toString | ( | char * | c | ) |
Converts char to string. In the case of nullptr will return an empty string.
Definition at line 56 of file PyUtils.cpp.
std::string BaseUtils::Python::toString | ( | PyObject * | obj | ) |
Converts PyObject into string, if possible, or throws exception.
Definition at line 24 of file PyUtils.cpp.
Referenced by Py::Import::listOfFunctions(), pythonRuntimeInfo(), and toVectorString().
std::string BaseUtils::Python::toString | ( | wchar_t * | c | ) |
Definition at line 63 of file PyUtils.cpp.
std::vector< std::string > BaseUtils::Python::toVectorString | ( | PyObject * | obj | ) |
Converts PyObject into vector of strings, if possible, or throws exception.
Definition at line 35 of file PyUtils.cpp.
References toString().
Referenced by pythonRuntimeInfo().