diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-02-14 22:11:19 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-02-14 22:11:19 +0000 |
commit | e8eb240050b0bc309458438a5e3fb7861f702a34 (patch) | |
tree | b4169e84887b08bb78cd931ac5f8ed4371225334 /numpy/doc/constants.py | |
parent | 11943ab29867441fc0b8662f77eb788afc5f4f46 (diff) | |
download | numpy-e8eb240050b0bc309458438a5e3fb7861f702a34.tar.gz |
Document constants in numpy.doc.constants
Diffstat (limited to 'numpy/doc/constants.py')
-rw-r--r-- | numpy/doc/constants.py | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/numpy/doc/constants.py b/numpy/doc/constants.py new file mode 100644 index 000000000..8240aab8e --- /dev/null +++ b/numpy/doc/constants.py @@ -0,0 +1,80 @@ +""" +========= +Constants +========= + +Numpy includes several constants: + +%(constant_list)s +""" +import textwrap + +# Maintain same format as in numpy.add_newdocs +constants = [] +def add_newdoc(module, name, doc): + constants.append((name, doc)) + +add_newdoc('numpy', 'Inf', + """ + """) + +add_newdoc('numpy', 'Infinity', + """ + """) + +add_newdoc('numpy', 'NAN', + """ + """) + +add_newdoc('numpy', 'NINF', + """ + """) + +add_newdoc('numpy', 'NZERO', + """ + """) + +add_newdoc('numpy', 'NaN', + """ + """) + +add_newdoc('numpy', 'PINF', + """ + """) + +add_newdoc('numpy', 'PZERO', + """ + """) + +add_newdoc('numpy', 'e', + """ + """) + +add_newdoc('numpy', 'inf', + """ + """) + +add_newdoc('numpy', 'infty', + """ + """) + +add_newdoc('numpy', 'nan', + """ + """) + +add_newdoc('numpy', 'newaxis', + """ + """) + +if __doc__: + constants_str = [] + constants.sort() + for name, doc in constants: + constants_str.append(""".. const:: %s\n %s""" % ( + name, textwrap.dedent(doc).replace("\n", "\n "))) + constants_str = "\n".join(constants_str) + + __doc__ = __doc__ % dict(constant_list=constants_str) + del constants_str, name, doc + +del constants, add_newdoc |