summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime <jaime.frio@gmail.com>2015-01-23 12:15:09 -0800
committerJaime <jaime.frio@gmail.com>2015-01-23 12:15:09 -0800
commite0807a56f6c6717b006ba80c86c3149d51990f63 (patch)
tree55bf5bdda25cef22e4503763a22771b52a771d92
parentd5e02707c041e97b0b6779e6d73eeb8b236576c7 (diff)
parent90199336e34891448ce4052f322228906a72c774 (diff)
downloadnumpy-e0807a56f6c6717b006ba80c86c3149d51990f63.tar.gz
Merge pull request #5476 from juliantaylor/merge-cbase
merge _compiled_base module into multiarray
-rw-r--r--.gitignore4
-rw-r--r--numpy/add_newdocs.py18
-rw-r--r--numpy/bento.info2
-rw-r--r--numpy/core/bscript1
-rw-r--r--numpy/core/setup.py1
-rw-r--r--numpy/core/src/multiarray/compiled_base.c (renamed from numpy/lib/src/_compiled_base.c)202
-rw-r--r--numpy/core/src/multiarray/compiled_base.h24
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c23
-rw-r--r--numpy/core/src/multiarray/multiarraymodule_onefile.c1
-rw-r--r--numpy/core/src/umath/umathmodule.c45
-rw-r--r--numpy/lib/bento.info6
-rw-r--r--numpy/lib/bscript11
-rw-r--r--numpy/lib/function_base.py6
-rw-r--r--numpy/lib/index_tricks.py2
-rw-r--r--numpy/lib/npyio.py2
-rw-r--r--numpy/lib/setup.py22
16 files changed, 148 insertions, 222 deletions
diff --git a/.gitignore b/.gitignore
index 3952be1fe..8387f4a03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -126,8 +126,8 @@ numpy/core/src/npysort/selection.c
numpy/core/src/npysort/sort.c
numpy/core/src/private/npy_binsearch.h
numpy/core/src/private/npy_partition.h
-numpy/core/src/private/scalarmathmodule.h
-numpy/core/src/scalarmathmodule.c
+numpy/core/src/private/templ_common.h
+numpy/core/src/umath/scalarmath.c
numpy/core/src/umath/funcs.inc
numpy/core/src/umath/loops.[ch]
numpy/core/src/umath/operand_flag_tests.c
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 66b889cc9..72aaf5ec7 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -4832,11 +4832,11 @@ add_newdoc('numpy.core.umath', 'seterrobj',
##############################################################################
#
-# lib._compiled_base functions
+# compiled_base functions
#
##############################################################################
-add_newdoc('numpy.lib._compiled_base', 'digitize',
+add_newdoc('numpy.core.multiarray', 'digitize',
"""
digitize(x, bins, right=False)
@@ -4916,7 +4916,7 @@ add_newdoc('numpy.lib._compiled_base', 'digitize',
array([1, 3, 3, 4, 5])
""")
-add_newdoc('numpy.lib._compiled_base', 'bincount',
+add_newdoc('numpy.core.multiarray', 'bincount',
"""
bincount(x, weights=None, minlength=None)
@@ -4989,7 +4989,7 @@ add_newdoc('numpy.lib._compiled_base', 'bincount',
""")
-add_newdoc('numpy.lib._compiled_base', 'ravel_multi_index',
+add_newdoc('numpy.core.multiarray', 'ravel_multi_index',
"""
ravel_multi_index(multi_index, dims, mode='raise', order='C')
@@ -5046,7 +5046,7 @@ add_newdoc('numpy.lib._compiled_base', 'ravel_multi_index',
1621
""")
-add_newdoc('numpy.lib._compiled_base', 'unravel_index',
+add_newdoc('numpy.core.multiarray', 'unravel_index',
"""
unravel_index(indices, dims, order='C')
@@ -5089,7 +5089,7 @@ add_newdoc('numpy.lib._compiled_base', 'unravel_index',
""")
-add_newdoc('numpy.lib._compiled_base', 'add_docstring',
+add_newdoc('numpy.core.multiarray', 'add_docstring',
"""
add_docstring(obj, docstring)
@@ -5099,7 +5099,7 @@ add_newdoc('numpy.lib._compiled_base', 'add_docstring',
raise a TypeError
""")
-add_newdoc('numpy.lib._compiled_base', 'add_newdoc_ufunc',
+add_newdoc('numpy.core.umath', '_add_newdoc_ufunc',
"""
add_ufunc_docstring(ufunc, new_docstring)
@@ -5125,7 +5125,7 @@ add_newdoc('numpy.lib._compiled_base', 'add_newdoc_ufunc',
and then throwing away the ufunc.
""")
-add_newdoc('numpy.lib._compiled_base', 'packbits',
+add_newdoc('numpy.core.multiarray', 'packbits',
"""
packbits(myarray, axis=None)
@@ -5169,7 +5169,7 @@ add_newdoc('numpy.lib._compiled_base', 'packbits',
""")
-add_newdoc('numpy.lib._compiled_base', 'unpackbits',
+add_newdoc('numpy.core.multiarray', 'unpackbits',
"""
unpackbits(myarray, axis=None)
diff --git a/numpy/bento.info b/numpy/bento.info
index 1bed9c711..9b91fe3ab 100644
--- a/numpy/bento.info
+++ b/numpy/bento.info
@@ -1,5 +1,5 @@
Recurse:
- core, fft, lib, linalg, random
+ core, fft, linalg, random
Library:
Packages:
diff --git a/numpy/core/bscript b/numpy/core/bscript
index 0f0f6816a..48d18b885 100644
--- a/numpy/core/bscript
+++ b/numpy/core/bscript
@@ -440,6 +440,7 @@ def pre_build(context):
pjoin('src', 'multiarray', 'buffer.c'),
pjoin('src', 'multiarray', 'calculation.c'),
pjoin('src', 'multiarray', 'common.c'),
+ pjoin('src', 'multiarray', 'compiled_base.c'),
pjoin('src', 'multiarray', 'conversion_utils.c'),
pjoin('src', 'multiarray', 'convert.c'),
pjoin('src', 'multiarray', 'convert_datatype.c'),
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index f178c4032..75d64d81b 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -797,6 +797,7 @@ def configuration(parent_package='',top_path=None):
join('src', 'multiarray', 'array_assign_array.c'),
join('src', 'multiarray', 'buffer.c'),
join('src', 'multiarray', 'calculation.c'),
+ join('src', 'multiarray', 'compiled_base.c'),
join('src', 'multiarray', 'common.c'),
join('src', 'multiarray', 'convert.c'),
join('src', 'multiarray', 'convert_datatype.c'),
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 9d9344526..d258d1ad8 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -3,10 +3,11 @@
#include <structmember.h>
#include <string.h>
+#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/npy_3kcompat.h"
+#include "numpy/npy_math.h"
#include "npy_config.h"
-#include "numpy/ufuncobject.h"
/*
@@ -88,7 +89,7 @@ minmax(const npy_intp *data, npy_intp data_len, npy_intp *mn, npy_intp *mx)
* The third argument, if present, is a minimum length desired for the
* output array.
*/
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyArray_Descr *type;
@@ -202,7 +203,7 @@ fail:
* i = 0 or i = len(bins) as appropriate. If right == True the comparison
* is bins [i - 1] < x <= bins[i] or bins [i - 1] >= x > bins[i]
*/
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_digitize(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyObject *obj_x = NULL;
@@ -300,8 +301,6 @@ arr_digitize(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
return ret;
}
-static char arr_insert__doc__[] = "Insert vals sequentially into equivalent 1-d positions indicated by mask.";
-
/*
* Insert values from an input array into an output array, at positions
* indicated by a mask. If the arrays are of dtype object (indicated by
@@ -355,7 +354,7 @@ arr_insert_loop(char *mptr, char *vptr, char *input_data, char *zero,
* Returns input array with values inserted sequentially into places
* indicated by the mask
*/
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
{
PyObject *mask = NULL, *vals = NULL;
@@ -513,7 +512,7 @@ binary_search(double key, double arr [], npy_intp len)
return imin - 1;
}
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
{
@@ -783,7 +782,7 @@ end_while:
}
/* ravel_multi_index implementation - see add_newdocs.py */
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_ravel_multi_index(PyObject *self, PyObject *args, PyObject *kwds)
{
int i, s;
@@ -987,7 +986,7 @@ unravel_index_loop_forder(int unravel_ndim, npy_intp *unravel_dims,
}
/* unravel_index implementation - see add_newdocs.py */
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds)
{
PyObject *indices0 = NULL, *ret_tuple = NULL;
@@ -1181,24 +1180,47 @@ fail:
}
-static PyTypeObject *PyMemberDescr_TypePtr = NULL;
-static PyTypeObject *PyGetSetDescr_TypePtr = NULL;
-static PyTypeObject *PyMethodDescr_TypePtr = NULL;
-
/* Can only be called if doc is currently NULL */
-static PyObject *
+NPY_NO_EXPORT PyObject *
arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *obj;
PyObject *str;
char *docstr;
static char *msg = "already has a docstring";
+ PyObject *tp_dict;
+ PyObject *myobj;
+ static PyTypeObject *PyMemberDescr_TypePtr = NULL;
+ static PyTypeObject *PyGetSetDescr_TypePtr = NULL;
+ static PyTypeObject *PyMethodDescr_TypePtr = NULL;
/* Don't add docstrings */
if (Py_OptimizeFlag > 1) {
Py_INCREF(Py_None);
return Py_None;
}
+
+ if (PyGetSetDescr_TypePtr == NULL) {
+ tp_dict = PyArrayDescr_Type.tp_dict;
+ /* Get "subdescr" */
+ myobj = PyDict_GetItemString(tp_dict, "fields");
+ if (myobj != NULL) {
+ PyGetSetDescr_TypePtr = Py_TYPE(myobj);
+ }
+ }
+ if (PyMemberDescr_TypePtr == NULL) {
+ myobj = PyDict_GetItemString(tp_dict, "alignment");
+ if (myobj != NULL) {
+ PyMemberDescr_TypePtr = Py_TYPE(myobj);
+ }
+ }
+ if (PyMethodDescr_TypePtr == NULL) {
+ myobj = PyDict_GetItemString(tp_dict, "newbyteorder");
+ if (myobj != NULL) {
+ PyMethodDescr_TypePtr = Py_TYPE(myobj);
+ }
+ }
+
#if defined(NPY_PY3K)
if (!PyArg_ParseTuple(args, "OO!", &obj, &PyUnicode_Type, &str)) {
return NULL;
@@ -1270,48 +1292,6 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
-/* docstring in numpy.add_newdocs.py */
-static PyObject *
-add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
-{
- PyUFuncObject *ufunc;
- PyObject *str;
- char *docstr, *newdocstr;
-
-#if defined(NPY_PY3K)
- if (!PyArg_ParseTuple(args, "O!O!", &PyUFunc_Type, &ufunc,
- &PyUnicode_Type, &str)) {
- return NULL;
- }
- docstr = PyBytes_AS_STRING(PyUnicode_AsUTF8String(str));
-#else
- if (!PyArg_ParseTuple(args, "O!O!", &PyUFunc_Type, &ufunc,
- &PyString_Type, &str)) {
- return NULL;
- }
- docstr = PyString_AS_STRING(str);
-#endif
-
- if (NULL != ufunc->doc) {
- PyErr_SetString(PyExc_ValueError,
- "Cannot change docstring of ufunc with non-NULL docstring");
- return NULL;
- }
-
- /*
- * This introduces a memory leak, as the memory allocated for the doc
- * will not be freed even if the ufunc itself is deleted. In practice
- * this should not be a problem since the user would have to
- * repeatedly create, document, and throw away ufuncs.
- */
- newdocstr = malloc(strlen(docstr) + 1);
- strcpy(newdocstr, docstr);
- ufunc->doc = newdocstr;
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
/*
* This function packs boolean values in the input array into the bits of a
* byte array. Truth values are determined as usual: 0 is false, everything
@@ -1576,7 +1556,7 @@ fail:
}
-static PyObject *
+NPY_NO_EXPORT PyObject *
io_pack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyObject *obj;
@@ -1590,7 +1570,7 @@ io_pack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
return pack_bits(obj, axis);
}
-static PyObject *
+NPY_NO_EXPORT PyObject *
io_unpack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyObject *obj;
@@ -1603,109 +1583,3 @@ io_unpack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
}
return unpack_bits(obj, axis);
}
-
-/* The docstrings for many of these methods are in add_newdocs.py. */
-static struct PyMethodDef methods[] = {
- {"_insert", (PyCFunction)arr_insert,
- METH_VARARGS | METH_KEYWORDS, arr_insert__doc__},
- {"bincount", (PyCFunction)arr_bincount,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"digitize", (PyCFunction)arr_digitize,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"interp", (PyCFunction)arr_interp,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"ravel_multi_index", (PyCFunction)arr_ravel_multi_index,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"unravel_index", (PyCFunction)arr_unravel_index,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"add_docstring", (PyCFunction)arr_add_docstring,
- METH_VARARGS, NULL},
- {"add_newdoc_ufunc", (PyCFunction)add_newdoc_ufunc,
- METH_VARARGS, NULL},
- {"packbits", (PyCFunction)io_pack,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"unpackbits", (PyCFunction)io_unpack,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {NULL, NULL, 0, NULL} /* sentinel */
-};
-
-static void
-define_types(void)
-{
- PyObject *tp_dict;
- PyObject *myobj;
-
- tp_dict = PyArrayDescr_Type.tp_dict;
- /* Get "subdescr" */
- myobj = PyDict_GetItemString(tp_dict, "fields");
- if (myobj == NULL) {
- return;
- }
- PyGetSetDescr_TypePtr = Py_TYPE(myobj);
- myobj = PyDict_GetItemString(tp_dict, "alignment");
- if (myobj == NULL) {
- return;
- }
- PyMemberDescr_TypePtr = Py_TYPE(myobj);
- myobj = PyDict_GetItemString(tp_dict, "newbyteorder");
- if (myobj == NULL) {
- return;
- }
- PyMethodDescr_TypePtr = Py_TYPE(myobj);
- return;
-}
-
-#if defined(NPY_PY3K)
-static struct PyModuleDef moduledef = {
- PyModuleDef_HEAD_INIT,
- "_compiled_base",
- NULL,
- -1,
- methods,
- NULL,
- NULL,
- NULL,
- NULL
-};
-#endif
-
-#if defined(NPY_PY3K)
-#define RETVAL m
-PyMODINIT_FUNC PyInit__compiled_base(void)
-#else
-#define RETVAL
-PyMODINIT_FUNC
-init_compiled_base(void)
-#endif
-{
- PyObject *m, *d;
-
-#if defined(NPY_PY3K)
- m = PyModule_Create(&moduledef);
-#else
- m = Py_InitModule("_compiled_base", methods);
-#endif
- if (!m) {
- return RETVAL;
- }
-
- /* Import the array objects */
- import_array();
- import_umath();
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
-
- /*
- * PyExc_Exception should catch all the standard errors that are
- * now raised instead of the string exception "numpy.lib.error".
- * This is for backward compatibility with existing code.
- */
- PyDict_SetItemString(d, "error", PyExc_Exception);
-
-
- /* define PyGetSetDescr_Type and PyMemberDescr_Type */
- define_types();
-
- return RETVAL;
-}
diff --git a/numpy/core/src/multiarray/compiled_base.h b/numpy/core/src/multiarray/compiled_base.h
new file mode 100644
index 000000000..19e3778ad
--- /dev/null
+++ b/numpy/core/src/multiarray/compiled_base.h
@@ -0,0 +1,24 @@
+#ifndef _NPY_PRIVATE__COMPILED_BASE_H_
+#define _NPY_PRIVATE__COMPILED_BASE_H_
+#include <numpy/ndarraytypes.h>
+
+NPY_NO_EXPORT PyObject *
+arr_insert(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+arr_bincount(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+arr_digitize(PyObject *, PyObject *, PyObject *kwds);
+NPY_NO_EXPORT PyObject *
+arr_interp(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+arr_ravel_multi_index(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+arr_unravel_index(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+arr_add_docstring(PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+io_pack(PyObject *, PyObject *, PyObject *);
+NPY_NO_EXPORT PyObject *
+io_unpack(PyObject *, PyObject *, PyObject *);
+
+#endif
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index e02494efd..79e471cee 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -59,6 +59,7 @@ NPY_NO_EXPORT int NPY_NUMUSERTYPES = 0;
#include "cblasfuncs.h"
#include "vdot.h"
#include "templ_common.h" /* for npy_mul_with_overflow_intp */
+#include "compiled_base.h"
/* Only here for API compatibility */
NPY_NO_EXPORT PyTypeObject PyBigArray_Type;
@@ -3864,8 +3865,6 @@ array_may_share_memory(PyObject *NPY_UNUSED(ignored), PyObject *args)
}
}
-
-
static struct PyMethodDef array_module_methods[] = {
{"_get_ndarray_c_version",
(PyCFunction)array__get_ndarray_c_version,
@@ -4012,6 +4011,26 @@ static struct PyMethodDef array_module_methods[] = {
{"test_interrupt",
(PyCFunction)test_interrupt,
METH_VARARGS, NULL},
+ {"_insert", (PyCFunction)arr_insert,
+ METH_VARARGS | METH_KEYWORDS,
+ "Insert vals sequentially into equivalent 1-d positions "
+ "indicated by mask."},
+ {"bincount", (PyCFunction)arr_bincount,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"digitize", (PyCFunction)arr_digitize,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"interp", (PyCFunction)arr_interp,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"ravel_multi_index", (PyCFunction)arr_ravel_multi_index,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"unravel_index", (PyCFunction)arr_unravel_index,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"add_docstring", (PyCFunction)arr_add_docstring,
+ METH_VARARGS, NULL},
+ {"packbits", (PyCFunction)io_pack,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"unpackbits", (PyCFunction)io_unpack,
+ METH_VARARGS | METH_KEYWORDS, NULL},
{NULL, NULL, 0, NULL} /* sentinel */
};
diff --git a/numpy/core/src/multiarray/multiarraymodule_onefile.c b/numpy/core/src/multiarray/multiarraymodule_onefile.c
index 7adfdf9da..3940d009b 100644
--- a/numpy/core/src/multiarray/multiarraymodule_onefile.c
+++ b/numpy/core/src/multiarray/multiarraymodule_onefile.c
@@ -54,6 +54,7 @@
#include "arrayobject.c"
#include "numpymemoryview.c"
#include "multiarraymodule.c"
+#include "compiled_base.c"
#if defined(HAVE_CBLAS)
#include "python_xerbla.c"
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 2c84027f9..d792e8b24 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -197,6 +197,49 @@ ufunc_frompyfunc(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *NPY_UNUS
return (PyObject *)self;
}
+/* docstring in numpy.add_newdocs.py */
+static PyObject *
+add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
+{
+ PyUFuncObject *ufunc;
+ PyObject *str;
+ char *docstr, *newdocstr;
+
+#if defined(NPY_PY3K)
+ if (!PyArg_ParseTuple(args, "O!O!", &PyUFunc_Type, &ufunc,
+ &PyUnicode_Type, &str)) {
+ return NULL;
+ }
+ docstr = PyBytes_AS_STRING(PyUnicode_AsUTF8String(str));
+#else
+ if (!PyArg_ParseTuple(args, "O!O!", &PyUFunc_Type, &ufunc,
+ &PyString_Type, &str)) {
+ return NULL;
+ }
+ docstr = PyString_AS_STRING(str);
+#endif
+
+ if (NULL != ufunc->doc) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot change docstring of ufunc with non-NULL docstring");
+ return NULL;
+ }
+
+ /*
+ * This introduces a memory leak, as the memory allocated for the doc
+ * will not be freed even if the ufunc itself is deleted. In practice
+ * this should not be a problem since the user would have to
+ * repeatedly create, document, and throw away ufuncs.
+ */
+ newdocstr = malloc(strlen(docstr) + 1);
+ strcpy(newdocstr, docstr);
+ ufunc->doc = newdocstr;
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
/*
*****************************************************************************
** SETUP UFUNCS **
@@ -241,6 +284,8 @@ static struct PyMethodDef methods[] = {
{"geterrobj",
(PyCFunction) ufunc_geterr,
METH_VARARGS, NULL},
+ {"_add_newdoc_ufunc", (PyCFunction)add_newdoc_ufunc,
+ METH_VARARGS, NULL},
{NULL, NULL, 0, NULL} /* sentinel */
};
diff --git a/numpy/lib/bento.info b/numpy/lib/bento.info
deleted file mode 100644
index 9f4fa6f0f..000000000
--- a/numpy/lib/bento.info
+++ /dev/null
@@ -1,6 +0,0 @@
-HookFile: bscript
-
-Library:
- Extension: _compiled_base
- Sources:
- src/_compiled_base.c
diff --git a/numpy/lib/bscript b/numpy/lib/bscript
deleted file mode 100644
index 61debfe41..000000000
--- a/numpy/lib/bscript
+++ /dev/null
@@ -1,11 +0,0 @@
-from bento.commands import hooks
-
-@hooks.pre_build
-def build(context):
- context.tweak_extension("_compiled_base",
- includes=["../core/include", "../core/include/numpy", "../core",
- "../core/src/private"],
- defines=['_FILE_OFFSET_BITS=64',
- '_LARGEFILE_SOURCE=1',
- '_LARGEFILE64_SOURCE=1']
- )
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 135053e43..2baf83830 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -23,9 +23,9 @@ from numpy.core.fromnumeric import (
from numpy.core.numerictypes import typecodes, number
from numpy.lib.twodim_base import diag
from .utils import deprecate
-from ._compiled_base import _insert, add_docstring
-from ._compiled_base import digitize, bincount, interp as compiled_interp
-from ._compiled_base import add_newdoc_ufunc
+from numpy.core.multiarray import _insert, add_docstring
+from numpy.core.multiarray import digitize, bincount, interp as compiled_interp
+from numpy.core.umath import _add_newdoc_ufunc as add_newdoc_ufunc
from numpy.compat import long
# Force range to be a generator, for np.delete's usage.
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index f83024961..eb9aad6ad 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -12,7 +12,7 @@ from numpy.core.numerictypes import find_common_type
from . import function_base
import numpy.matrixlib as matrix
from .function_base import diff
-from numpy.lib._compiled_base import ravel_multi_index, unravel_index
+from numpy.core.multiarray import ravel_multi_index, unravel_index
from numpy.lib.stride_tricks import as_strided
makemat = matrix.matrix
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index a40de4fea..9d539d6ac 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -11,7 +11,7 @@ from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
-from ._compiled_base import packbits, unpackbits
+from numpy.core.multiarray import packbits, unpackbits
from ._iotools import (
LineSplitter, NameValidator, StringConverter, ConverterError,
ConverterLockError, ConversionWarning, _is_string_like, has_nested_fields,
diff --git a/numpy/lib/setup.py b/numpy/lib/setup.py
deleted file mode 100644
index 62d1dfbb8..000000000
--- a/numpy/lib/setup.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from __future__ import division, print_function
-
-from os.path import join
-
-def configuration(parent_package='',top_path=None):
- from numpy.distutils.misc_util import Configuration
-
- config = Configuration('lib', parent_package, top_path)
-
- config.add_include_dirs(join('..', 'core', 'include'))
-
- config.add_extension('_compiled_base',
- sources=[join('src', '_compiled_base.c')]
- )
-
- config.add_data_dir('tests')
-
- return config
-
-if __name__ == '__main__':
- from numpy.distutils.core import setup
- setup(configuration=configuration)