Xmipp
v3.23.11-Nereus
|
Functions | |
std::string | print_traceback () |
std::string | whichPython () |
void | initPython (const std::string &path) |
void | initPython () |
void | initPythonAndNumpy () |
PyObject * | getClassRef (const std::string &moduleName, const std::string &className) |
PyObject * | getFunctionRef (const std::string &moduleName, const std::string &funcName) |
template<typename T > | |
PyObject * | convertToNumpy (const MultidimArray< T > &array) |
void | initNumpy () |
template PyObject * | convertToNumpy< double > (MultidimArray< double > const &) |
template PyObject * | convertToNumpy< int > (MultidimArray< int > const &) |
PyObject * Python::convertToNumpy | ( | const MultidimArray< T > & | array | ) |
Create an Numpy reference array wrapper around data. This reference should be release using Py_DECREF() or Py_XDECREF()
array | to be wrapped |
Definition at line 112 of file python_utils.cpp.
template PyObject* Python::convertToNumpy< double > | ( | MultidimArray< double > const & | ) |
template PyObject* Python::convertToNumpy< int > | ( | MultidimArray< int > const & | ) |
PyObject * Python::getClassRef | ( | const std::string & | moduleName, |
const std::string & | className | ||
) |
Get a borrowed reference to a Python class This reference should be release using Py_DECREF() or Py_XDECREF()
moduleName | name of the module (script file name) |
className | name of the class within the module |
Definition at line 91 of file python_utils.cpp.
PyObject * Python::getFunctionRef | ( | const std::string & | moduleName, |
const std::string & | funcName | ||
) |
Get a new reference to a Python function This reference should be release using Py_DECREF() or Py_XDECREF()
moduleName | name of the module (script file name) |
funcName | name of the class within the module |
Definition at line 102 of file python_utils.cpp.
void Python::initNumpy | ( | ) |
Initialize Numpy arrays. Needs to be called from each compile unit
Definition at line 126 of file python_utils.cpp.
void Python::initPython | ( | const std::string & | path | ) |
Initialize default Python path will point to the python which has been initialized
Definition at line 64 of file python_utils.cpp.
void Python::initPython | ( | ) |
void Python::initPythonAndNumpy | ( | ) |
std::string Python::print_traceback | ( | ) |
This function outputs traceback of the last exception to the standard output
Definition at line 29 of file python_utils.cpp.
std::string Python::whichPython | ( | ) |
Returns path to the default python intrepreter Equivalent to 'which python'
Definition at line 53 of file python_utils.cpp.