Python script execution tool. (See Aqua::CalcServer::Python for details)
More...
#include <numpy/npy_no_deprecated_api.h>
#include <numpy/ndarraytypes.h>
#include <numpy/ufuncobject.h>
#include <numpy/npy_3kcompat.h>
#include <sstream>
#include "aquagpusph/AuxiliarMethods.hpp"
#include "aquagpusph/InputOutput/Logger.hpp"
#include "Python.hpp"
#include "SetScalar.hpp"
|
#define | PY_ARRAY_UNIQUE_SYMBOL AQUA_ARRAY_API |
| Define the extension module which this Python stuff should be linked to.
|
|
static PyObject * | get (PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds) |
| Get a variable by its name.
|
static PyObject * | set (PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds) |
| Set a variable by its name.
|
static PyObject * | logMsg (PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds) |
| Log a message from the Python.
|
PyMODINIT_FUNC | PyInit_aquagpusph (void) |
| Module initialization.
|
Python script execution tool. (See Aqua::CalcServer::Python for details)
◆ PY_ARRAY_UNIQUE_SYMBOL
#define PY_ARRAY_UNIQUE_SYMBOL AQUA_ARRAY_API |
◆ get()
PyObject * get |
( |
PyObject UNUSED_PARAM * | self, |
|
|
PyObject * | args, |
|
|
PyObject * | keywds ) |
|
static |
Get a variable by its name.
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ logMsg()
PyObject * logMsg |
( |
PyObject UNUSED_PARAM * | self, |
|
|
PyObject * | args, |
|
|
PyObject * | keywds ) |
|
static |
Log a message from the Python.
In AQUAgpusph the Python stdout and stderr are redirected to this function, such that:
- stdout messages will be logged with level 0
- stderr messages will be logged with level 3
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ PyInit_aquagpusph()
PyMODINIT_FUNC PyInit_aquagpusph |
( |
void | | ) |
|
◆ set()
PyObject * set |
( |
PyObject UNUSED_PARAM * | self, |
|
|
PyObject * | args, |
|
|
PyObject * | keywds ) |
|
static |
Set a variable by its name.
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ _stderr_redirect
const char* _stderr_redirect |
Initial value:= " \n\
class stderrWriter(object): \n\
def write(self, data): \n\
aquagpusph.log(0, data) \n\
def flush(self): \n\
pass \n\
\n"
stderr Python redirector.
- See also
- logMsg
◆ _stdout_redirect
const char* _stdout_redirect |
Initial value:= " \n\
class stdoutWriter(object): \n\
def write(self, data): \n\
aquagpusph.log(0, data) \n\
def flush(self): \n\
pass \n\
\n"
stdout Python redirector.
- See also
- logMsg
◆ methods
Initial value:= {
{ "get",
METH_VARARGS | METH_KEYWORDS,
"Get a variable" },
{ "set",
METH_VARARGS | METH_KEYWORDS,
"Set a variable" },
{ "log",
METH_VARARGS | METH_KEYWORDS,
"Log a message" },
{ NULL, NULL, 0, NULL }
}
static PyObject * get(PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds)
Get a variable by its name.
Definition Python.cpp:73
static PyObject * set(PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds)
Set a variable by its name.
Definition Python.cpp:108
static PyObject * logMsg(PyObject UNUSED_PARAM *self, PyObject *args, PyObject *keywds)
Log a message from the Python.
Definition Python.cpp:161
List of methods declared in the module.