summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2018-04-30 18:13:10 +0300
committerMarten van Kerkwijk <mhvk@astro.utoronto.ca>2018-05-28 09:36:25 -0400
commit69a77fb790d6545969c17f7aed0fe160a6a5bc6a (patch)
tree28d15fa34c3827610a46ec4cb8fc83aac9e4895b /doc/source
parent4291c9440b6586bc6b9deec55178c21f935b02a7 (diff)
downloadnumpy-69a77fb790d6545969c17f7aed0fe160a6a5bc6a.tar.gz
DOC: Clarify C-API for generalized ufuncs.
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/reference/c-api.generalized-ufuncs.rst7
-rw-r--r--doc/source/reference/c-api.ufunc.rst7
-rw-r--r--doc/source/reference/ufuncs.rst4
-rw-r--r--doc/source/user/c-info.ufunc-tutorial.rst1
4 files changed, 11 insertions, 8 deletions
diff --git a/doc/source/reference/c-api.generalized-ufuncs.rst b/doc/source/reference/c-api.generalized-ufuncs.rst
index a53228cb5..dd8cf6558 100644
--- a/doc/source/reference/c-api.generalized-ufuncs.rst
+++ b/doc/source/reference/c-api.generalized-ufuncs.rst
@@ -101,6 +101,7 @@ Dimension Index
enumerates the dimension names according to the order of the first
occurrence of each name in the signature.
+.. _details-of-signature:
Details of Signature
--------------------
@@ -126,9 +127,9 @@ The formal syntax of signatures is as follows::
<Output arguments> ::= <Argument list>
<Argument list> ::= nil | <Argument> | <Argument> "," <Argument list>
<Argument> ::= "(" <Core dimension list> ")"
- <Core dimension list> ::= nil | <Dimension name> |
- <Dimension name> "," <Core dimension list>
- <Dimension name> ::= valid Python variable name
+ <Core dimension list> ::= nil | <Core dimension name> |
+ <Core dimension name> "," <Core dimension list>
+ <Core dimension name> ::= valid Python variable name
Notes:
diff --git a/doc/source/reference/c-api.ufunc.rst b/doc/source/reference/c-api.ufunc.rst
index 5ac34edc1..ece6cc391 100644
--- a/doc/source/reference/c-api.ufunc.rst
+++ b/doc/source/reference/c-api.ufunc.rst
@@ -135,10 +135,11 @@ Functions
int nin, int nout, int identity, char* name, char* doc, int unused, char *signature)
This function is very similar to PyUFunc_FromFuncAndData above, but has
- an extra *signature* argument, to define generalized universal functions.
+ an extra *signature* argument, to define a
+ :ref:`generalized universal functions <c-api.generalized-ufuncs>`.
Similarly to how ufuncs are built around an element-by-element operation,
- gufuncs are around subarray-by-subarray operations, the signature defining
- the subarrays to operate on.
+ gufuncs are around subarray-by-subarray operations, the
+ :ref:`signature <details-of-signature>` defining the subarrays to operate on.
:param signature:
The signature for the new gufunc. Setting it to NULL is equivalent
diff --git a/doc/source/reference/ufuncs.rst b/doc/source/reference/ufuncs.rst
index 68d85ccf5..995542d77 100644
--- a/doc/source/reference/ufuncs.rst
+++ b/doc/source/reference/ufuncs.rst
@@ -424,8 +424,8 @@ advanced usage and will not typically be used.
provided by the **types** attribute of the ufunc object. For backwards
compatibility this argument can also be provided as *sig*, although
the long form is preferred. Note that this should not be confused with
- the generalized ufunc signature that is stored in the **signature**
- attribute of the of the ufunc object.
+ the generalized ufunc :ref:`signature <details-of-signature>` that is
+ stored in the **signature** attribute of the of the ufunc object.
*extobj*
diff --git a/doc/source/user/c-info.ufunc-tutorial.rst b/doc/source/user/c-info.ufunc-tutorial.rst
index cfba01c45..5818ff182 100644
--- a/doc/source/user/c-info.ufunc-tutorial.rst
+++ b/doc/source/user/c-info.ufunc-tutorial.rst
@@ -1057,6 +1057,7 @@ PyUFunc_FromFuncAndData Specification
What follows is the full specification of PyUFunc_FromFuncAndData, which
automatically generates a ufunc from a C function with the correct signature.
+.. seealso:: :c:func:`PyUFunc_FromFuncAndDataAndSignature`
.. c:function:: PyObject *PyUFunc_FromFuncAndData( \
PyUFuncGenericFunction* func, void** data, char* types, int ntypes, \