diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-10-10 11:16:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-10 11:16:19 +0100 |
commit | 4ce3b27846d6c79a36616ecc8a875178d6cb7d39 (patch) | |
tree | 751a373785b4b6b7ac93fc4d43ed95ea3fb07085 | |
parent | c63dd1316067f8d0ebe99f4f61cf9853b77e937d (diff) | |
download | numpy-4ce3b27846d6c79a36616ecc8a875178d6cb7d39.tar.gz |
DOC: remove 0 aliases, fix references
-rw-r--r-- | numpy/core/_add_newdocs_scalars.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/core/_add_newdocs_scalars.py b/numpy/core/_add_newdocs_scalars.py index 2339c0d17..12f30712a 100644 --- a/numpy/core/_add_newdocs_scalars.py +++ b/numpy/core/_add_newdocs_scalars.py @@ -176,11 +176,11 @@ add_newdoc_for_scalar_type('object_', [], Any Python object. """) -add_newdoc_for_scalar_type('str_', ['str0', 'unicode_'], +add_newdoc_for_scalar_type('str_', ['unicode_'], r""" A unicode string. - When used in array, this type strips trailing nulls. + When used in arrays, this type strips trailing null codepoints. Unlike the builtin `str`, this supports the buffer protocol, exposing its contents as UCS4: @@ -189,21 +189,21 @@ add_newdoc_for_scalar_type('str_', ['str0', 'unicode_'], b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00d\x00\x00\x00' """) -add_newdoc_for_scalar_type('bytes_', ['bytes0'], +add_newdoc_for_scalar_type('bytes_', ['string_'], r""" A byte string. - When used in array, this type strips trailing nulls. + When used in arrays, this type strips trailing null bytes. """) -add_newdoc_for_scalar_type('void', ['void0'], +add_newdoc_for_scalar_type('void', [], """ Either an opaque sequence of bytes, or a structure. >>> np.void(b'abcd') void(b'\x61\x62\x63\x64') - Structured `void` scalars can only be constructed via extraction from `structured_arrays`: + Structured `void` scalars can only be constructed via extraction from :ref:`structured_arrays`: >>> arr = np.array((1, 2), dtype=[('x', np.int8), ('y', np.int8)]) >>> arr[()] @@ -219,14 +219,14 @@ add_newdoc_for_scalar_type('datetime64', [], >>> np.datetime64(10, 'D') numpy.datetime64('1970-01-11') - See `arrays.datetime` for more information. + See :ref:`arrays.datetime` for more information. """) add_newdoc_for_scalar_type('timedelta64', [], """ A timedelta stored as a 64-bit integer. - See `arrays.datetime` for more information. + See :ref:`arrays.datetime` for more information. """) # TODO: work out how to put this on the base class, np.floating @@ -237,7 +237,7 @@ for float_name in ('half', 'single', 'double', 'longdouble'): Return a pair of integers, whose ratio is exactly equal to the original floating point number, and with a positive denominator. - Raise OverflowError on infinities and a ValueError on NaNs. + Raise `OverflowError` on infinities and a `ValueError` on NaNs. >>> np.{ftype}(10.0).as_integer_ratio() (10, 1) |