3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-23 12:55:17 +01:00
dft_tools/python/app4triqs/app4triqs_module_desc.py

77 lines
1.8 KiB
Python
Raw Normal View History

# Generated automatically using the command :
# c++2py ../../c++/app4triqs/app4triqs.hpp -p --members_read_only -N app4triqs -a app4triqs -m app4triqs_module -o app4triqs_module --moduledoc="The app4triqs python module" -C pytriqs --cxxflags="-std=c++17" --target_file_only
from cpp2py.wrap_generator import *
# The module
2019-10-09 22:23:25 +02:00
module = module_(full_name = "app4triqs_module", doc = r"The app4triqs python module", app_name = "app4triqs")
# Imports
# Add here all includes
module.add_include("app4triqs/app4triqs.hpp")
# Add here anything to add in the C++ code at the start, e.g. namespace using
module.add_preamble("""
#include <cpp2py/converters/string.hpp>
using namespace app4triqs;
""")
# The class toto
c = class_(
py_type = "Toto", # name of the python class
c_type = "app4triqs::toto", # name of the C++ class
2019-04-23 19:33:57 +02:00
doc = r"""A very useful and important class""", # doc of the C++ class
hdf5 = True,
arithmetic = ("add_only"),
comparisons = "==",
serializable = "tuple"
)
2019-04-23 19:33:57 +02:00
c.add_constructor("""()""", doc = r"""""")
2019-04-23 19:33:57 +02:00
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_format ()""",
is_static = True,
2019-04-23 19:33:57 +02:00
doc = r"""HDF5""")
c.add_property(name = "i",
getter = cfunction("int get_i ()"),
doc = r"""Simple accessor""")
module.add_class(c)
2019-04-23 19:33:57 +02:00
module.add_function ("int app4triqs::chain (int i, int j)", doc = r"""Chain digits of two integers
Parameters
----------
i
The first integer
j
The second integer
Returns
-------
out
An integer containing the digits of both i and j""")
2019-04-23 19:33:57 +02:00
module.generate_code()