diff options
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/conf.py | 2 | ||||
-rw-r--r-- | doc/source/dev/governance/people.rst | 12 | ||||
-rw-r--r-- | doc/source/reference/c-api.array.rst | 31 | ||||
-rw-r--r-- | doc/source/reference/routines.linalg.rst | 1 | ||||
-rw-r--r-- | doc/source/reference/routines.polynomials.classes.rst | 48 | ||||
-rw-r--r-- | doc/source/reference/routines.testing.rst | 2 | ||||
-rw-r--r-- | doc/source/user/building.rst | 4 | ||||
-rw-r--r-- | doc/source/user/quickstart.rst | 34 |
8 files changed, 79 insertions, 55 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py index bf2935536..9ac729961 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -126,6 +126,8 @@ htmlhelp_basename = 'numpy' pngmath_use_preview = True pngmath_dvipng_args = ['-gamma', '1.5', '-D', '96', '-bg', 'Transparent'] +plot_html_show_formats = False +plot_html_show_source_link = False # ----------------------------------------------------------------------------- # LaTeX output diff --git a/doc/source/dev/governance/people.rst b/doc/source/dev/governance/people.rst index a0f08b57d..b22852a5a 100644 --- a/doc/source/dev/governance/people.rst +++ b/doc/source/dev/governance/people.rst @@ -12,8 +12,6 @@ Steering council * Ralf Gommers -* Alex Griffing - * Charles Harris * Nathaniel Smith @@ -22,12 +20,22 @@ Steering council * Pauli Virtanen +* Eric Wieser + +* Marten van Kerkwijk + +* Stephan Hoyer + +* Allan Haldane + Emeritus members ---------------- * Travis Oliphant - Project Founder / Emeritus Leader (served: 2005-2012) +* Alex Griffing (served: 2015-2017) + NumFOCUS Subcommittee --------------------- diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 1291dc93c..90bb56b2d 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -257,7 +257,7 @@ From scratch PyTypeObject* subtype, int nd, npy_intp* dims, int type_num, \ npy_intp* strides, void* data, int itemsize, int flags, PyObject* obj) - This is similar to :c:func:`PyArray_DescrNew` (...) except you + This is similar to :c:func:`PyArray_NewFromDescr` (...) except you specify the data-type descriptor with *type_num* and *itemsize*, where *type_num* corresponds to a builtin (or user-defined) type. If the type always has the same number of bytes, then @@ -455,8 +455,7 @@ From other objects is deleted (presumably after your calculations are complete), its contents will be copied back into *op* and the *op* array will be made writeable again. If *op* is not writeable to begin - with, then an error is raised. If *op* is not already an array, - then this flag has no effect. + with, or if it is not already an array, then an error is raised. .. c:var:: NPY_ARRAY_BEHAVED @@ -2887,10 +2886,10 @@ to. to a C-array of :c:type:`npy_intp`. The Python object could also be a single number. The *seq* variable is a pointer to a structure with members ptr and len. On successful return, *seq* ->ptr contains a - pointer to memory that must be freed to avoid a memory leak. The - restriction on memory size allows this converter to be - conveniently used for sequences intended to be interpreted as - array shapes. + pointer to memory that must be freed, by calling :c:func:`PyDimMem_FREE`, + to avoid a memory leak. The restriction on memory size allows this + converter to be conveniently used for sequences intended to be + interpreted as array shapes. .. c:function:: int PyArray_BufferConverter(PyObject* obj, PyArray_Chunk* buf) @@ -3063,6 +3062,24 @@ the C-API is needed then some additional steps must be taken. header file as long as you make sure that NO_IMPORT_ARRAY is #defined before #including that file. + Internally, these #defines work as follows: + + * If neither is defined, the C-API is declared to be + :c:type:`static void**`, so it is only visible within the + compilation unit that #includes numpy/arrayobject.h. + * If :c:macro:`PY_ARRAY_UNIQUE_SYMBOL` is #defined, but + :c:macro:`NO_IMPORT_ARRAY` is not, the C-API is declared to + be :c:type:`void**`, so that it will also be visible to other + compilation units. + * If :c:macro:`NO_IMPORT_ARRAY` is #defined, regardless of + whether :c:macro:`PY_ARRAY_UNIQUE_SYMBOL` is, the C-API is + declared to be :c:type:`extern void**`, so it is expected to + be defined in another compilation unit. + * Whenever :c:macro:`PY_ARRAY_UNIQUE_SYMBOL` is #defined, it + also changes the name of the variable holding the C-API, which + defaults to :c:data:`PyArray_API`, to whatever the macro is + #defined to. + Checking the API Version ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/reference/routines.linalg.rst b/doc/source/reference/routines.linalg.rst index 09c7d9b4e..4715f636e 100644 --- a/doc/source/reference/routines.linalg.rst +++ b/doc/source/reference/routines.linalg.rst @@ -18,6 +18,7 @@ Matrix and vector products matmul tensordot einsum + einsum_path linalg.matrix_power kron diff --git a/doc/source/reference/routines.polynomials.classes.rst b/doc/source/reference/routines.polynomials.classes.rst index 0db77eb7c..f44ddd46c 100644 --- a/doc/source/reference/routines.polynomials.classes.rst +++ b/doc/source/reference/routines.polynomials.classes.rst @@ -52,7 +52,7 @@ the conventional Polynomial class because of its familiarity:: >>> from numpy.polynomial import Polynomial as P >>> p = P([1,2,3]) >>> p - Polynomial([ 1., 2., 3.], [-1., 1.], [-1., 1.]) + Polynomial([ 1., 2., 3.], domain=[-1, 1], window=[-1, 1]) Note that there are three parts to the long version of the printout. The first is the coefficients, the second is the domain, and the third is the @@ -77,19 +77,19 @@ we ignore them and run through the basic algebraic and arithmetic operations. Addition and Subtraction:: >>> p + p - Polynomial([ 2., 4., 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 2., 4., 6.], domain=[-1, 1], window=[-1, 1]) >>> p - p - Polynomial([ 0.], [-1., 1.], [-1., 1.]) + Polynomial([ 0.], domain=[-1, 1], window=[-1, 1]) Multiplication:: >>> p * p - Polynomial([ 1., 4., 10., 12., 9.], [-1., 1.], [-1., 1.]) + Polynomial([ 1., 4., 10., 12., 9.], domain=[-1, 1], window=[-1, 1]) Powers:: >>> p**2 - Polynomial([ 1., 4., 10., 12., 9.], [-1., 1.], [-1., 1.]) + Polynomial([ 1., 4., 10., 12., 9.], domain=[-1, 1], window=[-1, 1]) Division: @@ -100,20 +100,20 @@ versions the '/' will only work for division by scalars. At some point it will be deprecated:: >>> p // P([-1, 1]) - Polynomial([ 5., 3.], [-1., 1.], [-1., 1.]) + Polynomial([ 5., 3.], domain=[-1, 1], window=[-1, 1]) Remainder:: >>> p % P([-1, 1]) - Polynomial([ 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 6.], domain=[-1, 1], window=[-1, 1]) Divmod:: >>> quo, rem = divmod(p, P([-1, 1])) >>> quo - Polynomial([ 5., 3.], [-1., 1.], [-1., 1.]) + Polynomial([ 5., 3.], domain=[-1, 1], window=[-1, 1]) >>> rem - Polynomial([ 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 6.], domain=[-1, 1], window=[-1, 1]) Evaluation:: @@ -134,7 +134,7 @@ the polynomials are regarded as functions this is composition of functions:: >>> p(p) - Polynomial([ 6., 16., 36., 36., 27.], [-1., 1.], [-1., 1.]) + Polynomial([ 6., 16., 36., 36., 27.], domain=[-1, 1], window=[-1, 1]) Roots:: @@ -148,11 +148,11 @@ tuples, lists, arrays, and scalars are automatically cast in the arithmetic operations:: >>> p + [1, 2, 3] - Polynomial([ 2., 4., 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 2., 4., 6.], domain=[-1, 1], window=[-1, 1]) >>> [1, 2, 3] * p - Polynomial([ 1., 4., 10., 12., 9.], [-1., 1.], [-1., 1.]) + Polynomial([ 1., 4., 10., 12., 9.], domain=[-1, 1], window=[-1, 1]) >>> p / 2 - Polynomial([ 0.5, 1. , 1.5], [-1., 1.], [-1., 1.]) + Polynomial([ 0.5, 1. , 1.5], domain=[-1, 1], window=[-1, 1]) Polynomials that differ in domain, window, or class can't be mixed in arithmetic:: @@ -180,7 +180,7 @@ conversion of Polynomial classes among themselves is done for type, domain, and window casting:: >>> p(T([0, 1])) - Chebyshev([ 2.5, 2. , 1.5], [-1., 1.], [-1., 1.]) + Chebyshev([ 2.5, 2. , 1.5], domain=[-1, 1], window=[-1, 1]) Which gives the polynomial `p` in Chebyshev form. This works because :math:`T_1(x) = x` and substituting :math:`x` for :math:`x` doesn't change @@ -195,18 +195,18 @@ Polynomial instances can be integrated and differentiated.:: >>> from numpy.polynomial import Polynomial as P >>> p = P([2, 6]) >>> p.integ() - Polynomial([ 0., 2., 3.], [-1., 1.], [-1., 1.]) + Polynomial([ 0., 2., 3.], domain=[-1, 1], window=[-1, 1]) >>> p.integ(2) - Polynomial([ 0., 0., 1., 1.], [-1., 1.], [-1., 1.]) + Polynomial([ 0., 0., 1., 1.], domain=[-1, 1], window=[-1, 1]) The first example integrates `p` once, the second example integrates it twice. By default, the lower bound of the integration and the integration constant are 0, but both can be specified.:: >>> p.integ(lbnd=-1) - Polynomial([-1., 2., 3.], [-1., 1.], [-1., 1.]) + Polynomial([-1., 2., 3.], domain=[-1, 1], window=[-1, 1]) >>> p.integ(lbnd=-1, k=1) - Polynomial([ 0., 2., 3.], [-1., 1.], [-1., 1.]) + Polynomial([ 0., 2., 3.], domain=[-1, 1], window=[-1, 1]) In the first case the lower bound of the integration is set to -1 and the integration constant is 0. In the second the constant of integration is set @@ -215,9 +215,9 @@ number of times the polynomial is differentiated:: >>> p = P([1, 2, 3]) >>> p.deriv(1) - Polynomial([ 2., 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 2., 6.], domain=[-1, 1], window=[-1, 1]) >>> p.deriv(2) - Polynomial([ 6.], [-1., 1.], [-1., 1.]) + Polynomial([ 6.], domain=[-1, 1], window=[-1, 1]) Other Polynomial Constructors @@ -233,9 +233,9 @@ are demonstrated below:: >>> from numpy.polynomial import Chebyshev as T >>> p = P.fromroots([1, 2, 3]) >>> p - Polynomial([ -6., 11., -6., 1.], [-1., 1.], [-1., 1.]) + Polynomial([ -6., 11., -6., 1.], domain=[-1, 1], window=[-1, 1]) >>> p.convert(kind=T) - Chebyshev([ -9. , 11.75, -3. , 0.25], [-1., 1.], [-1., 1.]) + Chebyshev([ -9. , 11.75, -3. , 0.25], domain=[-1, 1], window=[-1, 1]) The convert method can also convert domain and window:: @@ -249,9 +249,9 @@ available. The cast method works like the convert method while the basis method returns the basis polynomial of given degree:: >>> P.basis(3) - Polynomial([ 0., 0., 0., 1.], [-1., 1.], [-1., 1.]) + Polynomial([ 0., 0., 0., 1.], domain=[-1, 1], window=[-1, 1]) >>> T.cast(p) - Chebyshev([ -9. , 11.75, -3. , 0.25], [-1., 1.], [-1., 1.]) + Chebyshev([ -9. , 11.75, -3. , 0.25], domain=[-1, 1], window=[-1, 1]) Conversions between types can be useful, but it is *not* recommended for routine use. The loss of numerical precision in passing from a diff --git a/doc/source/reference/routines.testing.rst b/doc/source/reference/routines.testing.rst index c43aeeed9..ad95bb399 100644 --- a/doc/source/reference/routines.testing.rst +++ b/doc/source/reference/routines.testing.rst @@ -41,7 +41,6 @@ Decorators decorators.slow decorate_methods - Test Running ------------ .. autosummary:: @@ -50,3 +49,4 @@ Test Running Tester run_module_suite rundocs + suppress_warnings diff --git a/doc/source/user/building.rst b/doc/source/user/building.rst index fa3f2ccb4..b98f89c2d 100644 --- a/doc/source/user/building.rst +++ b/doc/source/user/building.rst @@ -32,7 +32,7 @@ Building NumPy requires the following software installed: FORTRAN 77 compiler installed. Note that NumPy is developed mainly using GNU compilers. Compilers from - other vendors such as Intel, Absoft, Sun, NAG, Compaq, Vast, Porland, + other vendors such as Intel, Absoft, Sun, NAG, Compaq, Vast, Portland, Lahey, HP, IBM, Microsoft are only supported in the form of community feedback, and may not work out of the box. GCC 4.x (and later) compilers are recommended. @@ -137,7 +137,7 @@ Additional compiler flags can be supplied by setting the ``OPT``, Building with ATLAS support --------------------------- -Ubuntu +Ubuntu ~~~~~~ You can install the necessary package for optimized ATLAS with this command:: diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst index 7295d1aca..4a10faae8 100644 --- a/doc/source/user/quickstart.rst +++ b/doc/source/user/quickstart.rst @@ -25,14 +25,12 @@ The Basics NumPy's main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a -tuple of positive integers. In NumPy dimensions are called *axes*. The -number of axes is *rank*. +tuple of positive integers. In NumPy dimensions are called *axes*. -For example, the coordinates of a point in 3D space ``[1, 2, 1]`` is an -array of rank 1, because it has one axis. That axis has a length of 3. -In the example pictured below, the array has rank 2 (it is 2-dimensional). -The first dimension (axis) has a length of 2, the second dimension has a -length of 3. +For example, the coordinates of a point in 3D space ``[1, 2, 1]`` has +one axis. That axis has 3 elements in it, so we say it has a length +of 3. In the example pictured below, the array has 2 axes. The first +axis has a length of 2, the second axis has a length of 3. :: @@ -46,14 +44,12 @@ arrays and offers less functionality. The more important attributes of an ``ndarray`` object are: ndarray.ndim - the number of axes (dimensions) of the array. In the Python world, - the number of dimensions is referred to as *rank*. + the number of axes (dimensions) of the array. ndarray.shape the dimensions of the array. This is a tuple of integers indicating the size of the array in each dimension. For a matrix with *n* rows and *m* columns, ``shape`` will be ``(n,m)``. The length of the - ``shape`` tuple is therefore the rank, or number of dimensions, - ``ndim``. + ``shape`` tuple is therefore the number of axes, ``ndim``. ndarray.size the total number of elements of the array. This is equal to the product of the elements of ``shape``. @@ -537,8 +533,8 @@ remaining axes. NumPy also allows you to write this using dots as ``b[i,...]``. The **dots** (``...``) represent as many colons as needed to produce a -complete indexing tuple. For example, if ``x`` is a rank 5 array (i.e., -it has 5 axes), then +complete indexing tuple. For example, if ``x`` is an array with 5 +axes, then - ``x[1,2,...]`` is equivalent to ``x[1,2,:,:,:]``, - ``x[...,3]`` to ``x[:,:,:,:,3]`` and @@ -1119,13 +1115,13 @@ value of time-dependent series:: [-0.53657292, 0.42016704, 0.99060736, 0.65028784], [-0.28790332, -0.96139749, -0.75098725, 0.14987721]]) >>> - >>> ind = data.argmax(axis=0) # index of the maxima for each series + >>> ind = data.argmax(axis=0) # index of the maxima for each series >>> ind array([2, 0, 3, 1]) >>> - >>> time_max = time[ ind] # times corresponding to the maxima + >>> time_max = time[ind] # times corresponding to the maxima >>> - >>> data_max = data[ind, xrange(data.shape[1])] # => data[ind[0],0], data[ind[1],1]... + >>> data_max = data[ind, range(data.shape[1])] # => data[ind[0],0], data[ind[1],1]... >>> >>> time_max array([ 82.5 , 20. , 113.75, 51.25]) @@ -1245,9 +1241,9 @@ selecting the slices we want:: Note that the length of the 1D boolean array must coincide with the length of the dimension (or axis) you want to slice. In the previous -example, ``b1`` is a 1-rank array with length 3 (the number of *rows* in -``a``), and ``b2`` (of length 4) is suitable to index the 2nd rank -(columns) of ``a``. +example, ``b1`` has length 3 (the number of *rows* in ``a``), and +``b2`` (of length 4) is suitable to index the 2nd axis (columns) of +``a``. The ix_() function ------------------- |