diff options
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/arraymethods.c | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 30 |
2 files changed, 28 insertions, 6 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 8f7bce20d..9cbe5b455 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -252,8 +252,6 @@ array_min(PyArrayObject *self, PyObject *args, PyObject *kwds) return PyArray_Min(self, axis, out); } -static char doc_abs[] = "a.abs() returns abs(a)"; - static char doc_swapaxes[] = "a.swapaxes(axis1, axis2) returns new view with axes swapped."; static PyObject * @@ -1808,8 +1806,6 @@ static PyMethodDef array_methods[] = { METH_VARARGS|METH_KEYWORDS, doc_min}, {"ptp", (PyCFunction)array_ptp, METH_VARARGS|METH_KEYWORDS, doc_ptp}, - {"abs", (PyCFunction)array_absolute, - METH_VARARGS, doc_abs}, {"mean", (PyCFunction)array_mean, METH_VARARGS|METH_KEYWORDS, doc_mean}, {"trace", (PyCFunction)array_trace, diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index bbe2bd893..99f1e9684 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -21,7 +21,8 @@ */ #define _MULTIARRAYMODULE -#include "numpy/noprefix.h" +#define NPY_NO_PREFIX +#include "numpy/arrayobject.h" #define PyAO PyArrayObject @@ -931,6 +932,10 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o return ret; } +/* Why doesn't this just call the ufunc? + All we need to do is add it to the list of needed ufuncs. + */ + /*MULTIARRAY_API Conjugate */ @@ -6427,6 +6432,24 @@ compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds) +#ifndef NPY_NO_SIGNAL + +static PyObject * +test_interrupt(PyObject *self) +{ + int a = 0; + NPY_SIGINT_ON + + while(1) { + a += 1; + } + + NPY_SIGINT_OFF + + return PyInt_FromLong(a); +} +#endif + static struct PyMethodDef array_module_methods[] = { {"_get_ndarray_c_version", (PyCFunction)array__get_ndarray_c_version, METH_VARARGS|METH_KEYWORDS, NULL}, @@ -6481,6 +6504,10 @@ static struct PyMethodDef array_module_methods[] = { METH_VARARGS | METH_KEYWORDS, NULL}, {"compare_chararrays", (PyCFunction)compare_chararrays, METH_VARARGS | METH_KEYWORDS, NULL}, +#ifndef NPY_NO_SIGNAL + {"test_interrupt", (PyCFunction)test_interrupt, + METH_NOARGS, NULL}, +#endif {NULL, NULL, 0} /* sentinel */ }; @@ -6680,7 +6707,6 @@ PyMODINIT_FUNC initmultiarray(void) { return; c_api = PyCObject_FromVoidPtr((void *)PyArray_API, NULL); - if (PyErr_Occurred()) goto err; PyDict_SetItemString(d, "_ARRAY_API", c_api); Py_DECREF(c_api); if (PyErr_Occurred()) goto err; |