diff --git a/c++/app4triqs/toto.hpp b/c++/app4triqs/toto.hpp index ea4f3052..4509e741 100644 --- a/c++/app4triqs/toto.hpp +++ b/c++/app4triqs/toto.hpp @@ -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 diff --git a/doc/conf.py.in b/doc/conf.py.in index ff1b11f9..4f7cb541 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -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' diff --git a/doc/contents.rst b/doc/contents.rst index ed14d6b1..7a599350 100644 --- a/doc/contents.rst +++ b/doc/contents.rst @@ -6,6 +6,12 @@ Documentation Contents -------- +.. math:: + + (a + b)^2 &= (a + b)(a + b) \\ + &= a^2 + 2ab + b^2 + + .. toctree:: :maxdepth: 5 @@ -27,6 +33,9 @@ C++ reference manual Python reference manual ----------------------- +.. automodule:: app4triqs + :members: + .. autoclass:: app4triqs.toto_module.toto :members: diff --git a/python/app4triqs/toto_module_desc.py b/python/app4triqs/toto_module_desc.py index a9117fc2..e7eea446 100644 --- a/python/app4triqs/toto_module_desc.py +++ b/python/app4triqs/toto_module_desc.py @@ -1,11 +1,12 @@ # 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 module = module_(full_name = "toto_module", doc = "", app_name = "app4triqs") # Imports +module.add_imports(*[]) # Add here all includes module.add_include("app4triqs/toto.hpp") @@ -23,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", + 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 ()"), @@ -44,7 +58,22 @@ 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 a new \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""")