Fixed corrupted default values in documentation #7148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
Motivation and Context
Devices in default values cause corrupted rendering in the documentation as shown in #7147.
The reason is that
o3d.core.Device.__repr__
returns a string like this:CPU:0
.Sphinx docs generation seems to misinterpret
:
in default values.Also, I found a similar problem with the enum VoxelPoolingMode.
The raw enum value also contains a
:
and causes faulty documentation.I found a similar issue here: sphinx-doc/sphinx#9266
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
In order to fix this, I changed
o3d.core.Device.__repr__
.Instead of
CPU:0
it now returnsDevice("CPU", 0)
(which is now also correct Python code).I fixed the VoxelPoolingMode issue using
py::arg_v
to define the Python representation explicitly.I marked this as a breaking change because it changes the output of
o3d.core.Device.__repr__
.Also, I fixed some minor typos, added mentioning of
SYCL
in some error messages and added the missing Python binding forDeviceType.SYCL
.