summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJay Bourque <jay.bourque@continuum.io>2013-05-13 10:50:55 -0500
committerJay Bourque <jay.bourque@continuum.io>2013-05-14 18:02:22 -0500
commitc2f30f9eca1a513601b27d2ae2a9c85d3ad15860 (patch)
tree29af816e49c4ba70f39ff9bf69f5ab50ba45c54e /numpy
parent84fa1845878c070f190f15e37507bb7575c39d06 (diff)
downloadnumpy-c2f30f9eca1a513601b27d2ae2a9c85d3ad15860.tar.gz
Change name of RegisterLoopForStructType to RegisterLoopByDescr
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/numpy_api.py2
-rw-r--r--numpy/core/src/umath/struct_ufunc_test.c.src10
-rw-r--r--numpy/core/src/umath/ufunc_object.c15
3 files changed, 15 insertions, 12 deletions
diff --git a/numpy/core/code_generators/numpy_api.py b/numpy/core/code_generators/numpy_api.py
index ea4ac9f07..2354f532f 100644
--- a/numpy/core/code_generators/numpy_api.py
+++ b/numpy/core/code_generators/numpy_api.py
@@ -384,7 +384,7 @@ ufunc_funcs_api = {
# End 1.6 API
'PyUFunc_DefaultTypeResolver': 39,
'PyUFunc_ValidateCasting': 40,
- 'PyUFunc_RegisterLoopForStructType': 41,
+ 'PyUFunc_RegisterLoopByDescr': 41,
}
# List of all the dicts which define the C API
diff --git a/numpy/core/src/umath/struct_ufunc_test.c.src b/numpy/core/src/umath/struct_ufunc_test.c.src
index cc7de1f46..fe3ef0bb1 100644
--- a/numpy/core/src/umath/struct_ufunc_test.c.src
+++ b/numpy/core/src/umath/struct_ufunc_test.c.src
@@ -106,11 +106,11 @@ PyMODINIT_FUNC initstruct_ufunc_test(void)
dtypes[1] = dtype;
dtypes[2] = dtype;
- PyUFunc_RegisterLoopForStructType(add_triplet,
- dtype,
- &add_uint64_triplet,
- dtypes,
- NULL);
+ PyUFunc_RegisterLoopByDescr(add_triplet,
+ dtype,
+ &add_uint64_triplet,
+ dtypes,
+ NULL);
d = PyModule_GetDict(m);
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index d0c84d6f5..6e7927b89 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -4425,18 +4425,21 @@ _loop1d_list_free(void *ptr)
/*
- * This function allows the user to register a 1-d loop for structured arrays
- * with an already created ufunc. The ufunc is called whenever any of it's input
- * arguments match the user_dtype argument.
+ * This function allows the user to register a 1-d loop with an already
+ * created ufunc. This function is similar to RegisterLoopForType except
+ * that it allows a 1-d loop to be registered with PyArray_Descr objects
+ * instead of dtype type num values. This allows a 1-d loop to be registered
+ * for a structured array dtype or a custom dtype. The ufunc is called
+ * whenever any of it's input arguments match the user_dtype argument.
* ufunc - ufunc object created from call to PyUFunc_FromFuncAndData
- * user_dtype - struct dtype that ufunc will be registered with
+ * user_dtype - dtype that ufunc will be registered with
* function - 1-d loop function pointer
- * arg_dtypes - array of struct dtype objects describing the ufunc operands
+ * arg_dtypes - array of dtype objects describing the ufunc operands
* data - arbitrary data pointer passed in to loop function
*/
/*UFUNC_API*/
NPY_NO_EXPORT int
-PyUFunc_RegisterLoopForStructType(PyUFuncObject *ufunc,
+PyUFunc_RegisterLoopByDescr(PyUFuncObject *ufunc,
PyArray_Descr *user_dtype,
PyUFuncGenericFunction function,
PyArray_Descr **arg_dtypes,