diff options
Diffstat (limited to 'doc/source')
| -rw-r--r-- | doc/source/conf.py | 2 | ||||
| -rw-r--r-- | doc/source/dev/development_environment.rst | 4 | ||||
| -rw-r--r-- | doc/source/reference/alignment.rst | 24 | ||||
| -rw-r--r-- | doc/source/reference/arrays.indexing.rst | 19 | ||||
| -rw-r--r-- | doc/source/reference/c-api.array.rst | 12 | ||||
| -rw-r--r-- | doc/source/reference/c-api.coremath.rst | 5 | ||||
| -rw-r--r-- | doc/source/reference/maskedarray.generic.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.ctypeslib.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.linalg.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.matlib.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.polynomials.package.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.polynomials.polynomial.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.random.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/routines.testing.rst | 2 | ||||
| -rw-r--r-- | doc/source/release.rst | 1 | ||||
| -rw-r--r-- | doc/source/user/numpy-for-matlab-users.rst | 12 |
16 files changed, 58 insertions, 37 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py index 455e9748b..072a3b44e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -39,7 +39,7 @@ source_suffix = '.rst' # General substitutions. project = 'NumPy' -copyright = '2008-2018, The SciPy community' +copyright = '2008-2019, The SciPy community' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. diff --git a/doc/source/dev/development_environment.rst b/doc/source/dev/development_environment.rst index aa4326f63..f9b438bfd 100644 --- a/doc/source/dev/development_environment.rst +++ b/doc/source/dev/development_environment.rst @@ -8,7 +8,9 @@ Recommended development setup Since NumPy contains parts written in C and Cython that need to be compiled before use, make sure you have the necessary compilers and Python -development headers installed - see :ref:`building-from-source`. +development headers installed - see :ref:`building-from-source`. Building +NumPy as of version ``1.17`` requires a C99 compliant compiler. For +some older compilers this may require ``export CFLAGS='-std=c99'``. Having compiled code also means that importing NumPy from the development sources needs some additional steps, which are explained below. For the rest diff --git a/doc/source/reference/alignment.rst b/doc/source/reference/alignment.rst index c749972b4..ebc8f353c 100644 --- a/doc/source/reference/alignment.rst +++ b/doc/source/reference/alignment.rst @@ -34,6 +34,14 @@ datatype is implemented as ``struct { float real, imag; }``. This has "true" alignment of 4 and "uint" alignment of 8 (equal to the true alignment of ``uint64``). +Some cases where uint and true alignment are different (default gcc linux): + arch type true-aln uint-aln + ---- ---- -------- -------- + x86_64 complex64 4 8 + x86_64 float128 16 8 + x86 float96 4 - + + Variables in Numpy which control and describe alignment ------------------------------------------------------- @@ -82,17 +90,15 @@ Here is how the variables above are used: appropriate N. Otherwise numpy copies by doing ``memcpy(dst, src, N)``. 5. Nditer code: Since this often calls the strided copy code, it must check for "uint alignment". - 6. Cast code: if the array is "uint aligned" this will essentially do - ``*dst = CASTFUNC(*src)``. If not, it does + 6. Cast code: This checks for "true" alignment, as it does + ``*dst = CASTFUNC(*src)`` if aligned. Otherwise, it does ``memmove(srcval, src); dstval = CASTFUNC(srcval); memmove(dst, dstval)`` where dstval/srcval are aligned. -Note that in principle, only "true alignment" is required for casting code. -However, because the casting code and copy code are deeply intertwined they -both use "uint" alignment. This should be safe assuming uint alignment is -always larger than true alignment, though it can cause unnecessary buffering if -an array is "true aligned" but not "uint aligned". If there is ever a big -rewrite of this code it would be good to allow them to use different -alignments. +Note that the strided-copy and strided-cast code are deeply intertwined and so +any arrays being processed by them must be both uint and true aligned, even +though the copy-code only needs uint alignment and the cast code only true +alignment. If there is ever a big rewrite of this code it would be good to +allow them to use different alignments. diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index 62d36e28c..3a319ecca 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -111,9 +111,10 @@ concepts to remember include: [5], [6]]]) -- :const:`Ellipsis` expand to the number of ``:`` objects needed to - make a selection tuple of the same length as ``x.ndim``. There may - only be a single ellipsis present. +- :const:`Ellipsis` expands to the number of ``:`` objects needed for the + selection tuple to index all dimensions. In most cases, this means that + length of the expanded selection tuple is ``x.ndim``. There may only be a + single ellipsis present. .. admonition:: Example @@ -513,14 +514,10 @@ only the part of the data in the specified field. Also :ref:`record array <arrays.classes.rec>` scalars can be "indexed" this way. Indexing into a structured array can also be done with a list of field names, -*e.g.* ``x[['field-name1','field-name2']]``. Currently this returns a new -array containing a copy of the values in the fields specified in the list. -As of NumPy 1.7, returning a copy is being deprecated in favor of returning -a view. A copy will continue to be returned for now, but a FutureWarning -will be issued when writing to the copy. If you depend on the current -behavior, then we suggest copying the returned array explicitly, i.e. use -x[['field-name1','field-name2']].copy(). This will work with both past and -future versions of NumPy. +*e.g.* ``x[['field-name1','field-name2']]``. As of NumPy 1.16 this returns a +view containing only those fields. In older versions of numpy it returned a +copy. See the user guide section on :ref:`structured_arrays` for more +information on multifield indexing. If the accessed field is a sub-array, the dimensions of the sub-array are appended to the shape of the result. diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 76aa680ae..7c298e118 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -307,10 +307,10 @@ From scratch .. c:function:: PyObject* PyArray_SimpleNewFromDescr( \ int nd, npy_intp* dims, PyArray_Descr* descr) - This function steals a reference to *descr* if it is not NULL. + This function steals a reference to *descr*. - Create a new array with the provided data-type descriptor, *descr* - , of the shape determined by *nd* and *dims*. + Create a new array with the provided data-type descriptor, *descr*, + of the shape determined by *nd* and *dims*. .. c:function:: PyArray_FILLWBYTE(PyObject* obj, int val) @@ -1904,10 +1904,10 @@ Item selection and manipulation all values are clipped to the region [0, len(*op*) ). -.. c:function:: PyObject* PyArray_Sort(PyArrayObject* self, int axis) +.. c:function:: PyObject* PyArray_Sort(PyArrayObject* self, int axis, NPY_SORTKIND kind) - Equivalent to :meth:`ndarray.sort<numpy.ndarray.sort>` (*self*, *axis*). Return an array with - the items of *self* sorted along *axis*. + Equivalent to :meth:`ndarray.sort<numpy.ndarray.sort>` (*self*, *axis*, *kind*). Return an array with + the items of *self* sorted along *axis*.Array is sorted according to *kind* which is an integer/enum pointing to the type of sorting algorithms used. .. c:function:: PyObject* PyArray_ArgSort(PyArrayObject* self, int axis) diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api.coremath.rst index 691f73287..bf08d4804 100644 --- a/doc/source/reference/c-api.coremath.rst +++ b/doc/source/reference/c-api.coremath.rst @@ -80,8 +80,9 @@ Floating point classification Useful math constants ~~~~~~~~~~~~~~~~~~~~~ -The following math constants are available in npy_math.h. Single and extended -precision are also available by adding the F and L suffixes respectively. +The following math constants are available in ``npy_math.h``. Single +and extended precision are also available by adding the ``f`` and +``l`` suffixes respectively. .. c:var:: NPY_E diff --git a/doc/source/reference/maskedarray.generic.rst b/doc/source/reference/maskedarray.generic.rst index 07ad6c292..7375d60fb 100644 --- a/doc/source/reference/maskedarray.generic.rst +++ b/doc/source/reference/maskedarray.generic.rst @@ -2,7 +2,7 @@ .. _maskedarray.generic: - +.. module:: numpy.ma The :mod:`numpy.ma` module ========================== diff --git a/doc/source/reference/routines.ctypeslib.rst b/doc/source/reference/routines.ctypeslib.rst index b04713b61..71b944a63 100644 --- a/doc/source/reference/routines.ctypeslib.rst +++ b/doc/source/reference/routines.ctypeslib.rst @@ -1,3 +1,5 @@ +.. module:: numpy.ctypeslib + *********************************************************** C-Types Foreign Function Interface (:mod:`numpy.ctypeslib`) *********************************************************** diff --git a/doc/source/reference/routines.linalg.rst b/doc/source/reference/routines.linalg.rst index 0520df413..c6bffc874 100644 --- a/doc/source/reference/routines.linalg.rst +++ b/doc/source/reference/routines.linalg.rst @@ -1,5 +1,7 @@ .. _routines.linalg: +.. module:: numpy.linalg + Linear algebra (:mod:`numpy.linalg`) ************************************ diff --git a/doc/source/reference/routines.matlib.rst b/doc/source/reference/routines.matlib.rst index a35eaec78..c7f675425 100644 --- a/doc/source/reference/routines.matlib.rst +++ b/doc/source/reference/routines.matlib.rst @@ -1,3 +1,5 @@ +.. module:: numpy.matlib + Matrix library (:mod:`numpy.matlib`) ************************************ diff --git a/doc/source/reference/routines.polynomials.package.rst b/doc/source/reference/routines.polynomials.package.rst index 61cb57fbb..7e40d9f00 100644 --- a/doc/source/reference/routines.polynomials.package.rst +++ b/doc/source/reference/routines.polynomials.package.rst @@ -1,3 +1,5 @@ +.. module:: numpy.polynomial + Polynomial Package ================== diff --git a/doc/source/reference/routines.polynomials.polynomial.rst b/doc/source/reference/routines.polynomials.polynomial.rst index 8194ca867..365c8da98 100644 --- a/doc/source/reference/routines.polynomials.polynomial.rst +++ b/doc/source/reference/routines.polynomials.polynomial.rst @@ -1,3 +1,5 @@ +.. module:: numpy.polynomial.polynomial + Polynomial Module (:mod:`numpy.polynomial.polynomial`) ====================================================== diff --git a/doc/source/reference/routines.random.rst b/doc/source/reference/routines.random.rst index c8b097d7d..cda4e2b61 100644 --- a/doc/source/reference/routines.random.rst +++ b/doc/source/reference/routines.random.rst @@ -1,5 +1,7 @@ .. _routines.random: +.. module:: numpy.random + Random sampling (:mod:`numpy.random`) ************************************* diff --git a/doc/source/reference/routines.testing.rst b/doc/source/reference/routines.testing.rst index 5a52a40d6..77c046768 100644 --- a/doc/source/reference/routines.testing.rst +++ b/doc/source/reference/routines.testing.rst @@ -1,5 +1,7 @@ .. _numpy-testing: +.. module:: numpy.testing + Test Support (:mod:`numpy.testing`) =================================== diff --git a/doc/source/release.rst b/doc/source/release.rst index 1cf215549..11a25d13e 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -2,6 +2,7 @@ Release Notes ************* +.. include:: ../release/1.17.0-notes.rst .. include:: ../release/1.16.0-notes.rst .. include:: ../release/1.15.4-notes.rst .. include:: ../release/1.15.3-notes.rst diff --git a/doc/source/user/numpy-for-matlab-users.rst b/doc/source/user/numpy-for-matlab-users.rst index 399237c21..16ee48c5e 100644 --- a/doc/source/user/numpy-for-matlab-users.rst +++ b/doc/source/user/numpy-for-matlab-users.rst @@ -547,7 +547,7 @@ Linear Algebra Equivalents - eigenvalues and eigenvectors of ``a`` * - ``[V,D]=eig(a,b)`` - - ``V,D = np.linalg.eig(a,b)`` + - ``D,V = scipy.linalg.eig(a,b)`` - eigenvalues and eigenvectors of ``a``, ``b`` * - ``[V,D]=eigs(a,k)`` @@ -693,19 +693,19 @@ this is just an example, not a statement of "best practices"): :: - # Make all numpy available via shorter 'num' prefix - import numpy as num + # Make all numpy available via shorter 'np' prefix + import numpy as np # Make all matlib functions accessible at the top level via M.func() import numpy.matlib as M # Make some matlib functions accessible directly at the top level via, e.g. rand(3,3) from numpy.matlib import rand,zeros,ones,empty,eye # Define a Hermitian function def hermitian(A, **kwargs): - return num.transpose(A,**kwargs).conj() + return np.transpose(A,**kwargs).conj() # Make some shortcuts for transpose,hermitian: - # num.transpose(A) --> T(A) + # np.transpose(A) --> T(A) # hermitian(A) --> H(A) - T = num.transpose + T = np.transpose H = hermitian Links |
