30 #include "../typeManipulation.hpp" 53 void callPyFunc( PyObject * func, PyObjectRef<> * args,
long long const argc );
61 template<
typename ... ARGS >
72 { internal::xincref( pyfunc ); }
82 constexpr
long long ARGC =
sizeof ... (args);
88 pyArgs[ i ] =
create( arg );
92 for( i = 0; i < ARGC; ++i )
94 if( pyArgs[ i ] ==
nullptr )
99 internal::callPyFunc( m_function, pyArgs, ARGC );
101 if( internal::err() )
std::enable_if_t< internal::canExportToNumpy< T >, PyObject *> create(T &value)
Create a NumPy 1D array of length 1 containing the scalar value.
Definition: numpyHelpers.hpp:147
PyObjectRef m_function
A reference to the wrapped python function.
Definition: PyFunc.hpp:107
void operator()(ARGS ... args)
Call the Python function with arguments args.
Definition: PyFunc.hpp:80
PythonFunction(PyObject *pyfunc)
create a PythonFunction around pyfunc.
Definition: PyFunc.hpp:70
Base class for all C++ exceptions related to Python.
Definition: pythonHelpers.hpp:332
DISABLE_HD_WARNING constexpr LVARRAY_HOST_DEVICE void forEachArg(F &&f)
The recursive base case where no argument is provided.
Definition: typeManipulation.hpp:129
Forward declarations of Python Objects.
A class that manages an owned Python reference with RAII semantics.
Definition: pythonHelpers.hpp:149
The top level namespace.
Definition: Array.hpp:24
Contains methods to help with conversion to python objects.
A C++ functor wrapper around a Python function.
Definition: PyFunc.hpp:62