summaryrefslogtreecommitdiff
path: root/doc/neps
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:16:06 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:20:45 -0600
commit8ddb0ce0acafe75d78df528b4d2540dfbf4b364d (patch)
tree156b23f48f14c7c1df699874007c521b5482d1a4 /doc/neps
parent13b0b272f764c14bc4ac34f5b19fd030d9c611a4 (diff)
downloadnumpy-8ddb0ce0acafe75d78df528b4d2540dfbf4b364d.tar.gz
STY: Giant whitespace cleanup.
Now is as good a time as any with open PR's at a low.
Diffstat (limited to 'doc/neps')
-rw-r--r--doc/neps/datetime-proposal.rst47
-rw-r--r--doc/neps/datetime-proposal3.rst1
-rw-r--r--doc/neps/deferred-ufunc-evaluation.rst8
-rw-r--r--doc/neps/generalized-ufuncs.rst4
-rw-r--r--doc/neps/groupby_additions.rst21
-rw-r--r--doc/neps/missing-data.rst6
-rw-r--r--doc/neps/new-iterator-ufunc.rst37
-rw-r--r--doc/neps/structured_array_extensions.txt1
-rw-r--r--doc/neps/warnfix.txt2
9 files changed, 61 insertions, 66 deletions
diff --git a/doc/neps/datetime-proposal.rst b/doc/neps/datetime-proposal.rst
index f72bab3ae..3bd15db34 100644
--- a/doc/neps/datetime-proposal.rst
+++ b/doc/neps/datetime-proposal.rst
@@ -6,7 +6,7 @@
:Contact: oliphant@enthought.com
:Date: 2009-06-09
-Revised only slightly from the third proposal by
+Revised only slightly from the third proposal by
:Author: Francesc Alted i Abad
:Contact: faltet@pytables.com
@@ -115,10 +115,10 @@ lower units respectively).
Finally, a date-time data-type can be created with support for tracking
sequential events within a basic unit: [D]//100, [Y]//4 (notice the
required brackets). These ``modulo`` event units provide the following
-interpretation to the date-time integer:
+interpretation to the date-time integer:
- * the divisor is the number of events in each period
- * the (integer) quotient is the integer number representing the base units
+ * the divisor is the number of events in each period
+ * the (integer) quotient is the integer number representing the base units
* the remainder is the particular event in the period.
Modulo event-units can be combined with any derived units, but brackets
@@ -140,7 +140,7 @@ i.e. you cannot specify 'M8[us]//5' as 'M8//5' or as '//5'
``datetime64``
==============
-
+
This dtype represents a time that is absolute (i.e. not relative). It
is implemented internally as an ``int64`` type. The integer represents
units from the internal POSIX epoch (see [3]_). Like POSIX, the
@@ -565,27 +565,27 @@ Necessary changes to NumPy
==========================
In order to facilitate the addition of the date-time data-types a few changes
-to NumPy were made:
+to NumPy were made:
Addition of metadata to dtypes
------------------------------
All data-types now have a metadata dictionary. It can be set using the
-metadata keyword during construction of the object.
+metadata keyword during construction of the object.
-Date-time data-types will place the word "__frequency__" in the meta-data
+Date-time data-types will place the word "__frequency__" in the meta-data
dictionary containing a 4-tuple with the following parameters.
-(basic unit string (str),
- number of multiples (int),
- number of sub-divisions (int),
- number of events (int)).
+(basic unit string (str),
+ number of multiples (int),
+ number of sub-divisions (int),
+ number of events (int)).
-Simple time units like 'D' for days will thus be specified by ('D', 1, 1, 1) in
-the "__frequency__" key of the metadata. More complicated time units (like '[2W/5]//50') will be indicated by ('D', 2, 5, 50).
+Simple time units like 'D' for days will thus be specified by ('D', 1, 1, 1) in
+the "__frequency__" key of the metadata. More complicated time units (like '[2W/5]//50') will be indicated by ('D', 2, 5, 50).
-The "__frequency__" key is reserved for metadata and cannot be set with a
-dtype constructor.
+The "__frequency__" key is reserved for metadata and cannot be set with a
+dtype constructor.
Ufunc interface extension
@@ -595,18 +595,18 @@ ufuncs that have datetime and timedelta arguments can use the Python API
during ufunc calls (to raise errors).
There is a new ufunc C-API call to set the data for a particular
-function pointer (for a particular set of data-types) to be the list of arrays
-passed in to the ufunc.
+function pointer (for a particular set of data-types) to be the list of arrays
+passed in to the ufunc.
Array Intervace Extensions
--------------------------
The array interface is extended to both handle datetime and timedelta
-typestr (including extended notation).
+typestr (including extended notation).
In addition, the typestr element of the __array_interface__ can be a tuple
-as long as the version string is 4. The tuple is
-('typestr', metadata dictionary).
+as long as the version string is 4. The tuple is
+('typestr', metadata dictionary).
This extension to the typestr concept extends to the descr portion of
the __array_interface__. Thus, the second element in the tuple of a
@@ -626,13 +626,13 @@ Multiple of basic units are simple to handle. Divisors of basic units
are harder to handle arbitrarily, but it is common to mentally think of
a month as 1/12 of a year, or a day as 1/7 of a week. Therefore, the
ability to specify a unit in terms of a fraction of a "larger" unit was
-implemented.
+implemented.
The event notion (//50) was added to solve a use-case of a commercial
sponsor of this NEP. The idea is to allow timestamp to carry both event
number and timestamp information. The remainder carries the event
number information, while the quotient carries the timestamp
-information.
+information.
Why the ``origin`` metadata disappeared
@@ -672,4 +672,3 @@ allowed.
.. coding: utf-8
.. fill-column: 72
.. End:
-
diff --git a/doc/neps/datetime-proposal3.rst b/doc/neps/datetime-proposal3.rst
index 6874aac13..ae98b8f03 100644
--- a/doc/neps/datetime-proposal3.rst
+++ b/doc/neps/datetime-proposal3.rst
@@ -572,4 +572,3 @@ for this proposal purposes.
.. coding: utf-8
.. fill-column: 72
.. End:
-
diff --git a/doc/neps/deferred-ufunc-evaluation.rst b/doc/neps/deferred-ufunc-evaluation.rst
index 95633cab5..634a1f238 100644
--- a/doc/neps/deferred-ufunc-evaluation.rst
+++ b/doc/neps/deferred-ufunc-evaluation.rst
@@ -97,7 +97,7 @@ Here's how it might be used in NumPy.::
There may be some surprising behavior, though.::
with np.deferredstate(True):
-
+
d = a + b + c
# d is deferred
@@ -159,7 +159,7 @@ The API would be expanded with a number of functions.
``int PyArray_CalculateAllDeferred()``
This function forces all currently deferred calculations to occur.
-
+
For example, if the error state is set to ignore all, and
np.seterr({all='raise'}), this would change what happens
to already deferred expressions. Thus, all the existing
@@ -185,7 +185,7 @@ The API would be expanded with a number of functions.
as an operand.
The Python API would be expanded as follows.
-
+
``numpy.setdeferred(state)``
Enables or disables deferred evaluation. True means to always
@@ -266,7 +266,7 @@ Other Implementation Details
============================
When a deferred array is created, it gets references to all the
-operands of the UFunc, along with the UFunc itself. The
+operands of the UFunc, along with the UFunc itself. The
'DeferredUsageCount' is incremented for each operand, and later
gets decremented when the deferred expression is calculated or
the deferred array is destroyed.
diff --git a/doc/neps/generalized-ufuncs.rst b/doc/neps/generalized-ufuncs.rst
index d9f3818b9..98e436990 100644
--- a/doc/neps/generalized-ufuncs.rst
+++ b/doc/neps/generalized-ufuncs.rst
@@ -91,14 +91,14 @@ dimensions. The signature is represented by a string of the
following format:
* Core dimensions of each input or output array are represented by a
- list of dimension names in parentheses, ``(i_1,...,i_N)``; a scalar
+ list of dimension names in parentheses, ``(i_1,...,i_N)``; a scalar
input/output is denoted by ``()``. Instead of ``i_1``, ``i_2``,
etc, one can use any valid Python variable name.
* Dimension lists for different arguments are separated by ``","``.
Input/output arguments are separated by ``"->"``.
* If one uses the same dimension name in multiple locations, this
enforces the same size (or broadcastable size) of the corresponding
- dimensions.
+ dimensions.
The formal syntax of signatures is as follows::
diff --git a/doc/neps/groupby_additions.rst b/doc/neps/groupby_additions.rst
index 28e1c29ac..a86bdd642 100644
--- a/doc/neps/groupby_additions.rst
+++ b/doc/neps/groupby_additions.rst
@@ -24,7 +24,7 @@ Suppose you have a NumPy structured array containing information about
the number of purchases at several stores over multiple days. To be clear, the
structured array data-type is:
-dt = [('year', i2), ('month', i1), ('day', i1), ('time', float),
+dt = [('year', i2), ('month', i1), ('day', i1), ('time', float),
('store', i4), ('SKU', 'S6'), ('number', i4)]
Suppose there is a 1-d NumPy array of this data-type and you would like
@@ -44,7 +44,7 @@ Ufunc methods proposed
It is proposed to add two new reduce-style methods to the ufuncs:
reduceby and reducein. The reducein method is intended to be a simpler
to use version of reduceat, while the reduceby method is intended to
-provide group-by capability on reductions.
+provide group-by capability on reductions.
reducein::
@@ -54,24 +54,24 @@ reducein::
The reduction occurs along the provided axis, using the provided
data-type to calculate intermediate results, storing the result into
- the array out (if provided).
+ the array out (if provided).
The indices array provides the start and end indices for the
reduction. If the length of the indices array is odd, then the
final index provides the beginning point for the final reduction
and the ending point is the end of arr.
- This generalizes along the given axis, the behavior:
+ This generalizes along the given axis, the behavior:
- [<ufunc>.reduce(arr[indices[2*i]:indices[2*i+1]])
+ [<ufunc>.reduce(arr[indices[2*i]:indices[2*i+1]])
for i in range(len(indices)/2)]
- This assumes indices is of even length
+ This assumes indices is of even length
- Example:
+ Example:
>>> a = [0,1,2,4,5,6,9,10]
- >>> add.reducein(a,[0,3,2,5,-2])
- [3, 11, 19]
+ >>> add.reducein(a,[0,3,2,5,-2])
+ [3, 11, 19]
Notice that sum(a[0:3]) = 3; sum(a[2:5]) = 11; and sum(a[-2:]) = 19
@@ -79,7 +79,7 @@ reduceby::
<ufunc>.reduceby(arr, by, dtype=None, out=None)
- Perform a reduction in arr over unique non-negative integers in by.
+ Perform a reduction in arr over unique non-negative integers in by.
Let N=arr.ndim and M=by.ndim. Then, by.shape[:N] == arr.shape.
@@ -109,4 +109,3 @@ edges::
.. coding: utf-8
.. fill-column: 72
.. End:
-
diff --git a/doc/neps/missing-data.rst b/doc/neps/missing-data.rst
index 338a8da96..0d03d7774 100644
--- a/doc/neps/missing-data.rst
+++ b/doc/neps/missing-data.rst
@@ -105,12 +105,12 @@ an array of all missing values must produce the same result as the
mean of a zero-sized array without missing value support.
This kind of data can arise when conforming sparsely sampled data
-into a regular sampling pattern, and is a useful interpretation to
+into a regular sampling pattern, and is a useful interpretation to
use when attempting to get best-guess answers for many statistical queries.
In R, many functions take a parameter "na.rm=T" which means to treat
the data as if the NA values are not part of the data set. This proposal
-defines a standard parameter "skipna=True" for this same purpose.
+defines a standard parameter "skipna=True" for this same purpose.
********************************************
Implementation Techniques For Missing Values
@@ -1174,7 +1174,7 @@ the discussion are::
Olivier Delalleau
Alan G Isaac
E. Antero Tammi
- Jason Grout
+ Jason Grout
Dag Sverre Seljebotn
Joe Harrington
Gary Strangman
diff --git a/doc/neps/new-iterator-ufunc.rst b/doc/neps/new-iterator-ufunc.rst
index 6c4bb6488..b253e874b 100644
--- a/doc/neps/new-iterator-ufunc.rst
+++ b/doc/neps/new-iterator-ufunc.rst
@@ -375,7 +375,7 @@ In general, it should be possible to emulate the current behavior where it
is desired, but I believe the default should be to produce and manipulate
memory layouts which will give the best performance.
-To support the new cache-friendly behavior, we introduce a new
+To support the new cache-friendly behavior, we introduce a new
option ‘K’ (for “keep”) for any ``order=`` parameter.
The proposed ‘order=’ flags become as follows:
@@ -691,7 +691,7 @@ Construction and Destruction
If copying is allowed, it will make a temporary copy if the data
is castable. If ``UPDATEIFCOPY`` is enabled, it will also copy
the data back with another cast upon iterator destruction.
-
+
If ``a_ndim`` is greater than zero, ``axes`` must also be provided.
In this case, ``axes`` is an ``a_ndim``-sized array of ``op``'s axes.
A value of -1 in ``axes`` means ``newaxis``. Within the ``axes``
@@ -748,7 +748,7 @@ Construction and Destruction
for each ``op[i]``.
The parameter ``oa_ndim``, when non-zero, specifies the number of
- dimensions that will be iterated with customized broadcasting.
+ dimensions that will be iterated with customized broadcasting.
If it is provided, ``op_axes`` must also be provided.
These two parameters let you control in detail how the
axes of the operand arrays get matched together and iterated.
@@ -778,7 +778,7 @@ Construction and Destruction
iterator, are:
``NPY_ITER_C_INDEX``, ``NPY_ITER_F_INDEX``
-
+
Causes the iterator to track an index matching C or
Fortran order. These options are mutually exclusive.
@@ -813,7 +813,7 @@ Construction and Destruction
data type, calculated based on the ufunc type promotion rules.
The flags for each operand must be set so that the appropriate
casting is permitted, and copying or buffering must be enabled.
-
+
If the common data type is known ahead of time, don't use this
flag. Instead, set the requested dtype for all the operands.
@@ -936,7 +936,7 @@ Construction and Destruction
is flagged for writing and is copied, causes the data
in a copy to be copied back to ``op[i]`` when the iterator
is destroyed.
-
+
If the operand is flagged as write-only and a copy is needed,
an uninitialized temporary array will be created and then copied
to back to ``op[i]`` on destruction, instead of doing
@@ -988,7 +988,7 @@ Construction and Destruction
For use with ``NPY_ITER_ALLOCATE``, this flag disables
allocating an array subtype for the output, forcing
it to be a straight ndarray.
-
+
TODO: Maybe it would be better to introduce a function
``NpyIter_GetWrappedOutput`` and remove this flag?
@@ -1009,7 +1009,7 @@ Construction and Destruction
Makes a copy of the given iterator. This function is provided
primarily to enable multi-threaded iteration of the data.
-
+
*TODO*: Move this to a section about multithreaded iteration.
The recommended approach to multithreaded iteration is to
@@ -1052,7 +1052,7 @@ Construction and Destruction
for any operand that later has ``NpyIter_UpdateIter`` called on it.
The flags that may be passed in ``op_flags`` are
- ``NPY_ITER_COPY``, ``NPY_ITER_UPDATEIFCOPY``,
+ ``NPY_ITER_COPY``, ``NPY_ITER_UPDATEIFCOPY``,
``NPY_ITER_NBO``, ``NPY_ITER_ALIGNED``, ``NPY_ITER_CONTIG``.
``int NpyIter_RemoveAxis(NpyIter *iter, npy_intp axis)``
@@ -1242,7 +1242,7 @@ Construction and Destruction
When using ranged iteration to multithread a reduction, there are
two possible ways to do the reduction:
-
+
If there is a big reduction to a small output, make a temporary
array initialized to the reduction unit for each thread, then have
each thread reduce into its temporary. When that is complete,
@@ -1341,14 +1341,14 @@ Construction and Destruction
handle their processing manually. By calling this function
before removing the axes, you can get the strides for the
manual processing.
-
+
Returns ``NULL`` on error.
``int NpyIter_GetShape(NpyIter *iter, npy_intp *outshape)``
Returns the broadcast shape of the iterator in ``outshape``.
This can only be called on an iterator which supports coordinates.
-
+
Returns ``NPY_SUCCEED`` or ``NPY_FAIL``.
``PyArray_Descr **NpyIter_GetDescrArray(NpyIter *iter)``
@@ -1658,7 +1658,7 @@ First, here is the definition of the ``luf`` function.::
def luf(lamdaexpr, *args, **kwargs):
"""Lambda UFunc
-
+
e.g.
c = luf(lambda i,j:i+j, a, b, order='K',
casting='safe', buffersize=8192)
@@ -1721,7 +1721,7 @@ Python iterator protocol.::
it = np.nditer([x,y,out], [],
[['readonly'],['readonly'],['writeonly','allocate']])
-
+
for (a, b, c) in it:
addop(a, b, c)
@@ -1734,7 +1734,7 @@ Here is the same function, but following the C-style pattern.::
it = np.nditer([x,y,out], [],
[['readonly'],['readonly'],['writeonly','allocate']])
-
+
while not it.finished:
addop(it[0], it[1], it[2])
it.iternext()
@@ -1772,7 +1772,7 @@ of the iterator, designed to help speed up the inner loops, is the flag
it = np.nditer([x,y,out], ['no_inner_iteration'],
[['readonly'],['readonly'],['writeonly','allocate']])
-
+
for (a, b, c) in it:
addop(a, b, c)
@@ -1809,7 +1809,7 @@ modify ``iter_add`` once again.::
def iter_add_itview(x, y, out=None):
it = np.nditer([x,y,out], [],
[['readonly'],['readonly'],['writeonly','allocate']])
-
+
(a, b, c) = it.itviews
np.add(a, b, c)
@@ -1900,7 +1900,7 @@ easy it was to add an optional output parameter.::
....: it[3] += it[0]
....: it.iternext()
....: return it.operands[3]
-
+
In [6]: timeit composite_over_it(image1, image2)
1 loops, best of 3: 197 ms per loop
@@ -1978,4 +1978,3 @@ a dual core machine.::
In [31]: ne.set_num_threads(1)
In [32]: timeit composite_over_ne_it(image1,image2)
10 loops, best of 3: 91.1 ms per loop
-
diff --git a/doc/neps/structured_array_extensions.txt b/doc/neps/structured_array_extensions.txt
index 7020c772c..716b98a76 100644
--- a/doc/neps/structured_array_extensions.txt
+++ b/doc/neps/structured_array_extensions.txt
@@ -6,4 +6,3 @@
2. Allow structured arrays to be sliced by their column (i.e. one additional indexing option for structured arrays) so that a[:4, 'foo':'bar'] would be allowed.
-
diff --git a/doc/neps/warnfix.txt b/doc/neps/warnfix.txt
index 03b809e3d..b6f307bcb 100644
--- a/doc/neps/warnfix.txt
+++ b/doc/neps/warnfix.txt
@@ -65,7 +65,7 @@ When applied to a variable, one would get:
int foo(int * NPY_UNUSED(dummy))
-expanded to
+expanded to
int foo(int * __NPY_UNUSED_TAGGEDdummy __COMP_NPY_UNUSED)