3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-22 12:23:41 +01:00

Make doc a bit more complex

This commit is contained in:
Olivier Parcollet 2019-04-23 13:33:57 -04:00
parent 815b397333
commit e055902496
4 changed files with 58 additions and 11 deletions

View File

@ -18,7 +18,7 @@ namespace app4triqs {
/**
* Construct from integer
*
* @param i_ a scalar
* @param i_ a scalar :math:`G(\tau)`
*/
explicit toto(int i_) : i(i_) {}
@ -35,6 +35,13 @@ namespace app4triqs {
/// Simple accessor
int get_i() const { return i; }
/**
* A simple function with :math:`G(\tau)`
*
* @param u Nothing useful
*/
int f(int u) { return u;}
/// Arithmetic operations
toto operator+(toto const &b) const;
toto &operator+=(toto const &b);
@ -57,8 +64,8 @@ namespace app4triqs {
*
* Chain the decimal digits of two integers i and j, and return the result
*
* @param :math:`i` The first integer
* @param :math:`j` The second integer
* @param i The first integer
* @param j The second integer
* @return An integer containing the digits of both i and j
*
* @remark

View File

@ -13,8 +13,8 @@ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'plot_directive',
'numpydoc',
'plot_directive',
'autorun']
source_suffix = '.rst'

View File

@ -6,6 +6,12 @@ Documentation
Contents
--------
.. math::
(a + b)^2 &= (a + b)(a + b) \\
&= a^2 + 2ab + b^2
.. toctree::
:maxdepth: 5
@ -15,6 +21,12 @@ Contents
changelog
about
Python
------
.. automodule:: app4triqs
:members:
Reference manual
----------------

View File

@ -1,5 +1,5 @@
# Generated automatically using the command :
# c++2py ../../c++/app4triqs/toto.hpp -p --members_read_only -N app4triqs -a app4triqs -m toto_module -o toto_module -C pytriqs --cxxflags="-std=c++17"
# c++2py ../../c++/app4triqs/toto.hpp -p --members_read_only -N app4triqs -a app4triqs -m toto_module -o toto_module -C pytriqs --cxxflags="-std=c++17 "
from cpp2py.wrap_generator import *
# The module
@ -24,20 +24,33 @@ using namespace app4triqs;
c = class_(
py_type = "Toto", # name of the python class
c_type = "app4triqs::toto", # name of the C++ class
doc = """A very useful and important class\n\n @note A Useful note""", # doc of the C++ class
doc = r"""A very useful and important class""", # doc of the C++ class
hdf5 = True,
arithmetic = ("add_only"),
comparisons = "==",
serializable = "tuple"
)
c.add_constructor("""()""", doc = """""")
c.add_constructor("""()""", doc = r"""""")
c.add_constructor("""(int i_)""", doc = """Construct from integer\n\n :param i_: a scalar""")
c.add_constructor("""(int i_)""", doc = r"""Construct from integer
Parameters
----------
i_
a scalar :math:`G(\tau)`""")
c.add_method("""int f (int u)""",
doc = r"""A simple function with :math:`G(\tau)`
Parameters
----------
u
Nothing useful""")
c.add_method("""std::string hdf5_scheme ()""",
is_static = True,
doc = """HDF5""")
doc = r"""HDF5""")
c.add_property(name = "i",
getter = cfunction("int get_i ()"),
@ -45,8 +58,23 @@ c.add_property(name = "i",
module.add_class(c)
module.add_function ("int app4triqs::chain (int i, int j)", doc = """Chain digits of two integers\n\n Chain the decimal digits of two integers i and j, and return the result\n\n @param :math:`i` The first integer\n @param :math:`j` The second integer\n @return An integer containing the digits of both i and j\n\n @remark""")
module.add_function ("int app4triqs::chain (int i, int j)", doc = r"""Chain digits of two integers
Chain the decimal digits of two integers i and j, and return the result
Parameters
----------
i
The first integer
j
The second integer
Returns
-------
out
An integer containing the digits of both i and j""")
module.generate_code()
module.generate_code()