From 7bcea9f884cac1708bac5aa48c86e26a247fab4e Mon Sep 17 00:00:00 2001 From: guoci Date: Sat, 10 Mar 2018 14:27:36 -0500 Subject: add documentation for constants --- numpy/doc/constants.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'numpy/doc/constants.py') 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) -- cgit v1.2.1