diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 5f0df5e14b..c4e8ea6c2c 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -148,6 +148,7 @@ html_theme = 'sphinx_immaterial' # html_theme_options = {} html_theme_options = { "toc_title_is_page_title": True, + "font": False, "repo_url": "https://github.com/lagadic/visp", "repo_name": "visp", "features": [ diff --git a/modules/python/doc/rst/dev/dev.rst b/modules/python/doc/rst/dev/dev.rst index e41f275ae0..ee075d4113 100644 --- a/modules/python/doc/rst/dev/dev.rst +++ b/modules/python/doc/rst/dev/dev.rst @@ -75,7 +75,7 @@ If you encounter a compilation error, make sure to first try rebuilding after cl Pybind did generate problems (an error at the pybind include line) that were solved like this. Static and member methods have the same name -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------------------------- If, when importing visp in python, you encounter this message: @@ -86,7 +86,7 @@ If, when importing visp in python, you encounter this message: Then it means that a class has both a static method and a member method with the same name. You should :ref:`rename either one through the config files `. Abstract class not detected -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------------------------- If you have this error: @@ -103,7 +103,8 @@ This error occurs because some methods are defined as pure virtual in a parent c Template errors -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------------------------- + If you have an issue that looks like: diff --git a/modules/python/doc/rst/python_api/python_specific_fns.rst b/modules/python/doc/rst/python_api/python_specific_fns.rst index 9ddba3a843..502c800b2c 100644 --- a/modules/python/doc/rst/python_api/python_specific_fns.rst +++ b/modules/python/doc/rst/python_api/python_specific_fns.rst @@ -10,11 +10,11 @@ Core module ---------------------- * :py:class:`~visp.core.PixelMeterConversion` and :py:class:`~visp.core.MeterPixelConversion` both -have a vectorised implementation of :code:`convertPoint`, called :code:`convertPoints`, accepting NumPy arrays + have a vectorised implementation of :code:`convertPoint`, called :code:`convertPoints`, accepting NumPy arrays MBT module ----------------------- * :py:class:`~visp.mbt.MbGenericTracker` as a reworked version of :py:meth:`visp.mbt.MbGenericTracker.track`, taking as inputs -maps of color images and of numpy representations (of shape H x W x 3) of the point clouds. + maps of color images and of numpy representations (of shape H x W x 3) of the point clouds. diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index 2e4fc4eafa..ccae166814 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -89,10 +89,8 @@ def to_cstring(s: str) -> str: current_char = 0 result = '' while current_char < len(s): - result += f'''R"doc( -{s[current_char: min((current_char + per_string_limit), len(s))]})doc" - -''' + result += f'''R"doc({s[current_char: min((current_char + per_string_limit), len(s))]})doc" + ''' current_char += per_string_limit return result diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 61376860da..913f7e9b28 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -230,9 +230,14 @@ def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[s def make_arg(name: str) -> str: return f'py::arg("{name}")' py_args = [] + arg_index = 0 for parameter in parameters: + parameter_name = parameter.name + if parameter_name is None: + parameter_name = f'arg{arg_index}' + if parameter.default is None or not parameter_can_have_default_value(parameter, specs, env_mapping): - py_args.append(make_arg(parameter.name)) + py_args.append(make_arg(parameter_name)) else: t = parameter.type gt = lambda typename: get_typename(typename, specs, env_mapping) @@ -260,7 +265,8 @@ def make_arg(name: str) -> str: default_value_rep = default_value_rep.replace('"', '\"') # Escape inner quotes in std::string args like std::string("hello"). This would break parsing at compile time default_value = env_mapping.get(default_value) or default_value - py_args.append(f'py::arg_v("{parameter.name}", {default_value}, "{default_value_rep}")') + py_args.append(f'py::arg_v("{parameter_name}", {default_value}, "{default_value_rep}")') + arg_index += 1 return py_args