summaryrefslogtreecommitdiff
path: root/numpy/doc
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2017-06-10 15:56:14 +1200
committerRalf Gommers <ralf.gommers@gmail.com>2017-06-10 18:19:17 +1200
commit34075a54e7aa10e80d41ef33ec7102292ecff0d5 (patch)
tree537ce22035ad4a22e7eba29720124b5eb82d4574 /numpy/doc
parentfa913a8ea6a8b363962dec6d656049a1371b53d9 (diff)
downloadnumpy-34075a54e7aa10e80d41ef33ec7102292ecff0d5.tar.gz
DOC: BLD: fix lots of Sphinx warnings/errors.
Diffstat (limited to 'numpy/doc')
-rw-r--r--numpy/doc/basics.py60
-rw-r--r--numpy/doc/glossary.py17
-rw-r--r--numpy/doc/subclassing.py2
3 files changed, 40 insertions, 39 deletions
diff --git a/numpy/doc/basics.py b/numpy/doc/basics.py
index dac236644..083d55a84 100644
--- a/numpy/doc/basics.py
+++ b/numpy/doc/basics.py
@@ -9,36 +9,36 @@ Array types and conversions between types
NumPy supports a much greater variety of numerical types than Python does.
This section shows which are available, and how to modify an array's data-type.
-========== ==========================================================
-Data type Description
-========== ==========================================================
-bool_ Boolean (True or False) stored as a byte
-int_ Default integer type (same as C ``long``; normally either
- ``int64`` or ``int32``)
-intc Identical to C ``int`` (normally ``int32`` or ``int64``)
-intp Integer used for indexing (same as C ``ssize_t``; normally
- either ``int32`` or ``int64``)
-int8 Byte (-128 to 127)
-int16 Integer (-32768 to 32767)
-int32 Integer (-2147483648 to 2147483647)
-int64 Integer (-9223372036854775808 to 9223372036854775807)
-uint8 Unsigned integer (0 to 255)
-uint16 Unsigned integer (0 to 65535)
-uint32 Unsigned integer (0 to 4294967295)
-uint64 Unsigned integer (0 to 18446744073709551615)
-float_ Shorthand for ``float64``.
-float16 Half precision float: sign bit, 5 bits exponent,
- 10 bits mantissa
-float32 Single precision float: sign bit, 8 bits exponent,
- 23 bits mantissa
-float64 Double precision float: sign bit, 11 bits exponent,
- 52 bits mantissa
-complex_ Shorthand for ``complex128``.
-complex64 Complex number, represented by two 32-bit floats (real
- and imaginary components)
-complex128 Complex number, represented by two 64-bit floats (real
- and imaginary components)
-========== ==========================================================
+============ ==========================================================
+Data type Description
+============ ==========================================================
+``bool_`` Boolean (True or False) stored as a byte
+``int_`` Default integer type (same as C ``long``; normally either
+ ``int64`` or ``int32``)
+intc Identical to C ``int`` (normally ``int32`` or ``int64``)
+intp Integer used for indexing (same as C ``ssize_t``; normally
+ either ``int32`` or ``int64``)
+int8 Byte (-128 to 127)
+int16 Integer (-32768 to 32767)
+int32 Integer (-2147483648 to 2147483647)
+int64 Integer (-9223372036854775808 to 9223372036854775807)
+uint8 Unsigned integer (0 to 255)
+uint16 Unsigned integer (0 to 65535)
+uint32 Unsigned integer (0 to 4294967295)
+uint64 Unsigned integer (0 to 18446744073709551615)
+``float_`` Shorthand for ``float64``.
+float16 Half precision float: sign bit, 5 bits exponent,
+ 10 bits mantissa
+float32 Single precision float: sign bit, 8 bits exponent,
+ 23 bits mantissa
+float64 Double precision float: sign bit, 11 bits exponent,
+ 52 bits mantissa
+``complex_`` Shorthand for ``complex128``.
+complex64 Complex number, represented by two 32-bit floats (real
+ and imaginary components)
+complex128 Complex number, represented by two 64-bit floats (real
+ and imaginary components)
+============ ==========================================================
Additionally to ``intc`` the platform dependent C integer types ``short``,
``long``, ``longlong`` and their unsigned versions are defined.
diff --git a/numpy/doc/glossary.py b/numpy/doc/glossary.py
index 97b7b3362..794c393f6 100644
--- a/numpy/doc/glossary.py
+++ b/numpy/doc/glossary.py
@@ -48,7 +48,7 @@ Glossary
array([(1, 2.0), (3, 4.0)],
dtype=[('x', '<i4'), ('y', '<f8')])
- Fast element-wise operations, called `ufuncs`_, operate on arrays.
+ Fast element-wise operations, called :term:`ufuncs`, operate on arrays.
array_like
Any sequence that can be interpreted as an ndarray. This includes
@@ -82,7 +82,7 @@ Glossary
array([[4, 5],
[5, 6]])
- See `doc.broadcasting`_ for more information.
+ See `numpy.doc.broadcasting` for more information.
C order
See `row-major`
@@ -155,7 +155,8 @@ Glossary
See `column-major`
flattened
- Collapsed to a one-dimensional array. See `ndarray.flatten`_ for details.
+ Collapsed to a one-dimensional array. See `numpy.ndarray.flatten`
+ for details.
immutable
An object that cannot be modified after execution is called
@@ -284,9 +285,9 @@ Glossary
See *array*.
record array
- An `ndarray`_ with `structured data type`_ which has been subclassed as
- np.recarray and whose dtype is of type np.record, making the
- fields of its data type to be accessible by attribute.
+ An :term:`ndarray` with :term:`structured data type`_ which has been
+ subclassed as ``np.recarray`` and whose dtype is of type ``np.record``,
+ making the fields of its data type to be accessible by attribute.
reference
If ``a`` is a reference to ``b``, then ``(a is b) == True``. Therefore,
@@ -348,10 +349,10 @@ Glossary
>>> x[:, 1]
array([2, 4])
-
+
structured data type
A data type composed of other datatypes
-
+
tuple
A sequence that may contain a variable number of types of any
kind. A tuple is immutable, i.e., once constructed it cannot be
diff --git a/numpy/doc/subclassing.py b/numpy/doc/subclassing.py
index 51d9dc120..c34278868 100644
--- a/numpy/doc/subclassing.py
+++ b/numpy/doc/subclassing.py
@@ -543,7 +543,7 @@ will be called, but now it sees an ``ndarray`` as the other argument. Likely,
it will know how to handle this, and return a new instance of the ``B`` class
to us. Our example class is not set up to handle this, but it might well be
the best approach if, e.g., one were to re-implement ``MaskedArray`` using
- ``__array_ufunc__``.
+``__array_ufunc__``.
As a final note: if the ``super`` route is suited to a given class, an
advantage of using it is that it helps in constructing class hierarchies.