diff options
-rw-r--r-- | doc/release/1.3.0-notes.rst | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/doc/release/1.3.0-notes.rst b/doc/release/1.3.0-notes.rst index d79414e67..f2e3bc8d4 100644 --- a/doc/release/1.3.0-notes.rst +++ b/doc/release/1.3.0-notes.rst @@ -19,7 +19,46 @@ http://www.python.org/dev/peps/pep-0361/ Generalized ufuncs ~~~~~~~~~~~~~~~~~~ -http://projects.scipy.org/numpy/ticket/887 +There is a general need for looping over not only functions on scalars but also +over functions on vectors (or arrays), as explained on +http://scipy.org/scipy/numpy/wiki/GeneralLoopingFunctions. We propose to +realize this concept by generalizing the universal functions (ufuncs), and +provide a C implementation that adds ~500 lines to the numpy code base. In +current (specialized) ufuncs, the elementary function is limited to +element-by-element operations, whereas the generalized version supports +"sub-array" by "sub-array" operations. The Perl vector library PDL provides a +similar functionality and its terms are re-used in the following. + +Each generalized ufunc has information associated with it that states what the +"core" dimensionality of the inputs is, as well as the corresponding +dimensionality of the outputs (the element-wise ufuncs have zero core +dimensions). The list of the core dimensions for all arguments is called the +"signature" of a ufunc. For example, the ufunc numpy.add has signature +"(),()->()" defining two scalar inputs and one scalar output. + +Another example is (see the GeneralLoopingFunctions page) the function +inner1d(a,b) with a signature of "(i),(i)->()". This applies the inner product +along the last axis of each input, but keeps the remaining indices intact. For +example, where a is of shape (3,5,N) and b is of shape (5,N), this will return +an output of shape (3,5). The underlying elementary function is called 3*5 +times. In the signature, we specify one core dimension "(i)" for each input and +zero core dimensions "()" for the output, since it takes two 1-d arrays and +returns a scalar. By using the same name "i", we specify that the two +corresponding dimensions should be of the same size (or one of them is of size +1 and will be broadcasted). + +The dimensions beyond the core dimensions are called "loop" dimensions. In the +above example, this corresponds to (3,5). + +The usual numpy "broadcasting" rules apply, where the signature determines how +the dimensions of each input/output object are split into core and loop +dimensions: + +While an input array has a smaller dimensionality than the corresponding number +of core dimensions, 1's are pre-pended to its shape. The core dimensions are +removed from all inputs and the remaining dimensions are broadcasted; defining +the loop dimensions. The output is given by the loop dimensions plus the +output core dimensions. Experimental Windows 64 bits support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -78,7 +117,13 @@ New ufuncs Masked arrays ~~~~~~~~~~~~~ -TODO +* structured arrays should now be fully supported by MaskedArray + (r6463, r6324, r6305, r6300, r6294...) +* Minor bug fixes (r6356, r6352, r6335, r6299, r6298) +* Improved support for __iter__ (r6326) +* made baseclass, sharedmask and hardmask accesible to the user (but +read-only) +* doc update gfortran support on windows ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -118,7 +163,8 @@ deprecated, and will be removed entirely in 1.4.0. Documentation changes ===================== -TODO +A lot of documentation has been added. Both user guide and references can be +built from sphinx. New C API ========= @@ -135,7 +181,8 @@ Ufunc API The following functions have been added to the ufunc API: - * TODO + * PyUFunc_FromFuncAndDataAndSignature: to declare a more general ufunc + (generalized ufunc). New defines ~~~~~~~~~~~ |