17 #pragma GCC diagnostic ignored "-Wunused-parameter"
18 #pragma GCC diagnostic ignored "-Wunused-function"
20 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
21 #include <numpy/arrayobject.h>
36 Types::EMVA methodType,
40 TDirectory *theBaseDir):
MethodBase(jobName, methodType, methodTitle, dsi, theOption, theBaseDir),
43 if (!PyIsInitialized()) {
72 PyObject *global = PyModule_GetDict(main);
75 PyObject *pycode = Py_BuildValue(
"(sOO)", code.
Data(), global, local);
94 PyObject *bName = PyString_FromString(
"__builtin__");
98 Log <<
kFATAL <<
"Can't import __builtin__" <<
Endl;
102 fEval = PyDict_GetItemString(mDict,
"eval");
107 PyObject *pName = PyString_FromString(
"pickle");
111 Log <<
kFATAL <<
"Can't import pickle" <<
Endl;
136 Py_SetProgramName(const_cast<char *>(name.
Data()));
146 if (!Py_IsInitialized())
return kFALSE;
MsgLogger & Endl(MsgLogger &ml)
static PyObject * fModulePickle
static PyObject * fModuleBuiltin
static int PyIsInitialized()
static void PyInitialize()
const char * Data() const
static PyObject * Eval(TString code)
PyMethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="", TDirectory *theBaseDir=0)
static TString Py_GetProgramName()
static void PySetProgramName(TString name)
Describe directory structure in memory.
static PyObject * fPickleLoads
static PyObject * fPickleDumps