BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Functions | |
PyObject * | createNumpyArray (const std::vector< double > &data) |
void | import_bornagain (const std::string &path="") |
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 * PyUtils::createNumpyArray | ( | const std::vector< double > & | data | ) |
Definition at line 172 of file PyUtils.cpp.
Referenced by Histogram1D::binCentersNumpy(), Histogram1D::binErrorsNumpy(), and Histogram1D::binValuesNumpy().
void PyUtils::import_bornagain | ( | const std::string & | path = "" | ) |
Imports BornAgain from given location. If path is empty, tries to rely on PYTHONPATH.
Definition at line 71 of file PyUtils.cpp.
Referenced by PyImport::createFromPython(), and PyImport::listOfFunctions().
std::string PyUtils::pythonRuntimeInfo | ( | ) |
Returns multi-line string representing PATH, PYTHONPATH, sys.path and other info.
Definition at line 100 of file PyUtils.cpp.
References SysUtils::getenv(), toString(), and toVectorString().
Referenced by pythonStackTrace().
std::string PyUtils::pythonStackTrace | ( | ) |
Returns string representing python stack trace.
Definition at line 132 of file PyUtils.cpp.
References pythonRuntimeInfo().
std::string PyUtils::toString | ( | char * | c | ) |
Converts char to string. In the case of nullptr will return an empty string.
Definition at line 55 of file PyUtils.cpp.
std::string PyUtils::toString | ( | PyObject * | obj | ) |
Converts PyObject into string, if possible, or throws exception.
Definition at line 24 of file PyUtils.cpp.
Referenced by IntensityDataCanvas::applyPersistentSettings(), ModelView::JsonModelConverter::from_json(), PyImport::listOfFunctions(), pythonRuntimeInfo(), gui2::ParserPropertyWidget::readSettings(), ModelView::ComboProperty::stringOfSelections(), ModelView::ComboProperty::stringOfValues(), TEST_F(), and toVectorString().
std::string PyUtils::toString | ( | wchar_t * | c | ) |
Definition at line 63 of file PyUtils.cpp.
std::vector< std::string > PyUtils::toVectorString | ( | PyObject * | obj | ) |
Converts PyObject into vector of strings, if possible, or throws exception.
Definition at line 33 of file PyUtils.cpp.
References toString().
Referenced by pythonRuntimeInfo().