diff options
author | guoci <zguoci@gmail.com> | 2018-03-10 14:27:36 -0500 |
---|---|---|
committer | guoci <zguoci@gmail.com> | 2018-03-10 14:27:36 -0500 |
commit | 7bcea9f884cac1708bac5aa48c86e26a247fab4e (patch) | |
tree | bff6f0cf5247562f6c46741aee0af7f43edb294c | |
parent | c486d8d0d496f6b366dc827a3d41ed1e9d593ec8 (diff) | |
download | python-numpy-7bcea9f884cac1708bac5aa48c86e26a247fab4e.tar.gz python-numpy-7bcea9f884cac1708bac5aa48c86e26a247fab4e.tar.bz2 python-numpy-7bcea9f884cac1708bac5aa48c86e26a247fab4e.zip |
add documentation for constants
-rw-r--r-- | doc/source/reference/constants.rst | 5 | ||||
-rw-r--r-- | doc/source/reference/index.rst | 1 | ||||
-rw-r--r-- | numpy/doc/constants.py | 26 |
3 files changed, 30 insertions, 2 deletions
diff --git a/doc/source/reference/constants.rst b/doc/source/reference/constants.rst new file mode 100644 index 000000000..46de7552a --- /dev/null +++ b/doc/source/reference/constants.rst @@ -0,0 +1,5 @@ +********* +Constants +********* + +.. automodule:: numpy.doc.constants diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 4f246096d..a2a8a0966 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -19,6 +19,7 @@ For learning how to use NumPy, see also :ref:`user`. :maxdepth: 2 arrays + constants ufuncs routines distutils diff --git a/numpy/doc/constants.py b/numpy/doc/constants.py index 6246813b7..c4db4c96a 100644 --- a/numpy/doc/constants.py +++ b/numpy/doc/constants.py @@ -3,6 +3,8 @@ Constants ========= +.. currentmodule:: numpy + NumPy includes several constants: %(constant_list)s @@ -225,7 +227,7 @@ add_newdoc('numpy', 'e', References ---------- - .. [1] http://en.wikipedia.org/wiki/Napier_constant + https://en.wikipedia.org/wiki/E_%28mathematical_constant%29 """) @@ -363,6 +365,26 @@ add_newdoc('numpy', 'newaxis', """) +add_newdoc('numpy', 'pi', + """ + ``pi = 3.1415926535897932384626433...`` + + References + ---------- + https://en.wikipedia.org/wiki/Pi + + """) + +add_newdoc('numpy', 'euler_gamma', + """ + ``γ = 0.5772156649015328606065120900824024310421...`` + + References + ---------- + https://en.wikipedia.org/wiki/Euler-Mascheroni_constant + + """) + if __doc__: constants_str = [] constants.sort() @@ -383,7 +405,7 @@ if __doc__: s = "\n".join(new_lines) # Done. - constants_str.append(""".. const:: %s\n %s""" % (name, s)) + constants_str.append(""".. data:: %s\n %s""" % (name, s)) constants_str = "\n".join(constants_str) __doc__ = __doc__ % dict(constant_list=constants_str) |