Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed corrupted default values in documentation #7148

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

timohl
Copy link
Contributor

@timohl timohl commented Jan 26, 2025

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.
voxelpoolingmode

I found a similar issue here: sphinx-doc/sphinx#9266

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

In order to fix this, I changed o3d.core.Device.__repr__.
Instead of CPU:0 it now returns Device("CPU", 0) (which is now also correct Python code).

o3d_device_in_default

I fixed the VoxelPoolingMode issue using py::arg_v to define the Python representation explicitly.
voxelpoolingmode_fixed

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 for DeviceType.SYCL.

Copy link

@joseph-sch joseph-sch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python API docs corrupted where last argument is device=core::Device("CPU:0")
2 participants