Skip to content

Commit

Permalink
Use system font when building documentation, cleanup some documentati…
Browse files Browse the repository at this point in the history
…on generation issues
  • Loading branch information
SamFlt committed Apr 15, 2024
1 parent 37cb738 commit 97a4a94
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions modules/python/doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
7 changes: 4 additions & 3 deletions modules/python/doc/rst/dev/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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 <Function options>`.

Abstract class not detected
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----------------------------------------------

If you have this error:

Expand All @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions modules/python/doc/rst/python_api/python_specific_fns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 2 additions & 4 deletions modules/python/generator/visp_python_bindgen/doc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions modules/python/generator/visp_python_bindgen/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 97a4a94

Please sign in to comment.