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

C++ Types in Python Documentation #6867

Closed
3 tasks done
timohl opened this issue Jul 14, 2024 · 1 comment · Fixed by #6869
Closed
3 tasks done

C++ Types in Python Documentation #6867

timohl opened this issue Jul 14, 2024 · 1 comment · Fixed by #6869
Labels
bug Not a build issue, this is likely a bug.

Comments

@timohl
Copy link
Contributor

timohl commented Jul 14, 2024

Checklist

Describe the issue

The python binding documentation contains multiple instances where C++ types instead of Python types are used.
Example: docs/0.18.0/open3d.core.Device
2. __init__(self: open3d.cpu.pybind.core.Device, arg0: open3d::core::Device::DeviceType, arg1: int) -> None
(Same issue is in the current main, but I referenced 0.18.0 to have a stable link)

This also creates missing types when using pybind11-stubgen as recommended in #3052.
pybind11-stubgen reports this as an invalid expression error during generation:
pybind11_stubgen - [ ERROR] In open3d.cpu.pybind.core.Device.__init__ : Invalid expression 'open3d::core::Device::DeviceType'

The cause of this issue is that the declaration using py::class_ comes after the type is referenced in a function defined with .def(...).
See pybind11-docs: "Avoiding C++ types in docstrings"

Steps to reproduce the bug

I followed the standard build process:
Build from source
Build documentation

I used pybind11-stubgen open3d to get a list of errors (however there are several other issues shown)

Error message

Full error output of
pybind11-stubgen open3d

pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Device.__init__ : Invalid expression 'open3d::core::Device::DeviceType'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Device.get_type : Invalid expression 'open3d::core::Device::DeviceType'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Dtype.__init__ : Invalid expression 'open3d::core::Dtype::DtypeCode'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Dtype.byte_code : Invalid expression 'open3d::core::Dtype::DtypeCode'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Tensor.from_dlpack : Can't find/import 'capsule'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.Tensor.to_dlpack : Can't find/import 'capsule'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.core.cuda.synchronize : Invalid expression 'open3d::core::Device'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.Geometry3D.get_minimal_oriented_bounding_box : Invalid expression 'open3d::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.Geometry3D.get_oriented_bounding_box : Invalid expression 'open3d::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.KDTreeFlann.__init__ : Can't find/import 'm'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.KDTreeFlann.__init__ : Can't find/import 'n'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.KDTreeFlann.__init__ : Invalid expression 'open3d::pipelines::registration::Feature'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.PointCloud.compute_convex_hull : Invalid expression 'open3d::geometry::TriangleMesh'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.PointCloud.create_from_depth_image : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.PointCloud.create_from_rgbd_image : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.TriangleMesh.textures. : Invalid expression 'open3d::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.geometry.TriangleMesh.textures. : Invalid expression 'open3d::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.io.rpc.set_mesh_data : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.odometry.compute_correspondence : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.odometry.compute_rgbd_odometry : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.Feature.data. : Can't find/import 'm'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.Feature.data. : Can't find/import 'n'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.Feature.data. : Can't find/import 'm'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.Feature.data. : Can't find/import 'n'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForColoredICP.__init__ : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForColoredICP.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForColoredICP.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP.__init__ : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationPointToPlane.__init__ : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationPointToPlane.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.TransformationEstimationPointToPlane.kernel. : Invalid expression 'open3d::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.evaluate_registration : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_colored_icp : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_fgr_based_on_correspondence : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_fgr_based_on_feature_matching : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_generalized_icp : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_icp : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_icp : Invalid expression 'TransformationEstimationPointToPoint without scaling.'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_ransac_based_on_correspondence : Invalid expression 'TransformationEstimationPointToPoint without scaling.'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.pipelines.registration.registration_ransac_based_on_feature_matching : Invalid expression 'TransformationEstimationPointToPoint without scaling.'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox.get_oriented_bounding_box : Invalid expression 'open3d::t::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.DrawableGeometry.material. : Invalid expression 'open3d::visualization::rendering::Material'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.DrawableGeometry.material. : Invalid expression 'open3d::visualization::rendering::Material'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.Image.resize : Invalid expression '<InterpType.Nearest: 0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.LineSet.extrude_linear : Invalid expression 'open3d::t::geometry::TriangleMesh'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.LineSet.extrude_rotation : Invalid expression 'open3d::t::geometry::TriangleMesh'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.LineSet.get_axis_aligned_bounding_box : Invalid expression 'open3d::t::geometry::AxisAlignedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.LineSet.get_oriented_bounding_box : Invalid expression 'open3d::t::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.OrientedBoundingBox.create_from_points : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.compute_convex_hull : Invalid expression 'open3d::t::geometry::TriangleMesh'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.create_from_depth_image : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.create_from_rgbd_image : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.extrude_linear : Invalid expression 'open3d::t::geometry::LineSet'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.extrude_rotation : Invalid expression 'open3d::t::geometry::LineSet'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.get_axis_aligned_bounding_box : Invalid expression 'open3d::t::geometry::AxisAlignedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.get_oriented_bounding_box : Invalid expression 'open3d::t::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.hidden_point_removal : Invalid expression 'open3d::t::geometry::TriangleMesh'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.orient_normals_to_align_with_direction : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.PointCloud.orient_normals_towards_camera_location : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.TriangleMesh.from_triangle_mesh_model : Invalid expression 'open3d::visualization::rendering::TriangleMeshModel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.TriangleMesh.get_axis_aligned_bounding_box : Invalid expression 'open3d::t::geometry::AxisAlignedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.geometry.TriangleMesh.get_oriented_bounding_box : Invalid expression 'open3d::t::geometry::OrientedBoundingBox'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.odometry.compute_odometry_information_matrix : Invalid expression 'open3d::t::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.odometry.rgbd_odometry_multi_scale : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimation.compute_transformation : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForColoredICP.__init__ : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForColoredICP.kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForColoredICP.kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.__init__ : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.compute_transformation : Invalid expression 'open3d::t::geometry::PointCloud'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.doppler_kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.doppler_kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.geometric_kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationForDopplerICP.geometric_kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationPointToPlane.__init__ : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationPointToPlane.kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.TransformationEstimationPointToPlane.kernel. : Invalid expression 'open3d::t::pipelines::registration::RobustKernel'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.evaluate_registration : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.icp : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.multi_scale_icp : Invalid expression '(with default value)'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.registration.robust_kernel.RobustKernel.__init__ : Invalid expression '<RobustKernelMethod.L2Loss: 0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.control_grid.deform : Invalid expression 'open3d::t::geometry::PointCloud'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.control_grid.deform : Invalid expression 'open3d::t::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.control_grid.deform : Invalid expression 'open3d::t::geometry::RGBDImage'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.control_grid.parameterize : Invalid expression 'open3d::t::geometry::PointCloud'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.control_grid.touch : Invalid expression 'open3d::t::geometry::PointCloud'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.run_rigid_optimizer_for_fragments : Invalid expression 'SLACOptimizerParams[max_iterations=5, voxel_size=5.000000e-02, distance_threshold=7.000000e-02, fitness_threshold=3.000000e-01, regularizer_weight=1.000000e+00, device=CPU:0, slac_folder=].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.run_rigid_optimizer_for_fragments : Invalid expression 'SLACDebugOption[debug=false, debug_start_node_idx=0].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.run_slac_optimizer_for_fragments : Invalid expression 'SLACOptimizerParams[max_iterations=5, voxel_size=5.000000e-02, distance_threshold=7.000000e-02, fitness_threshold=3.000000e-01, regularizer_weight=1.000000e+00, device=CPU:0, slac_folder=].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.run_slac_optimizer_for_fragments : Invalid expression 'SLACDebugOption[debug=false, debug_start_node_idx=0].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.save_correspondences_for_pointclouds : Invalid expression 'SLACOptimizerParams[max_iterations=5, voxel_size=5.000000e-02, distance_threshold=7.000000e-02, fitness_threshold=3.000000e-01, regularizer_weight=1.000000e+00, device=CPU:0, slac_folder=].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slac.save_correspondences_for_pointclouds : Invalid expression 'SLACDebugOption[debug=false, debug_start_node_idx=0].'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slam.Frame.get_data_as_image : Invalid expression 'open3d::t::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slam.Frame.set_data_from_image : Invalid expression 'open3d::t::geometry::Image'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slam.Model.voxel_grid. : Invalid expression 'open3d::t::geometry::VoxelBlockGrid'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.t.pipelines.slam.Model.voxel_grid. : Invalid expression 'open3d::t::geometry::VoxelBlockGrid'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.Material.__init__ : Invalid expression 'open3d::visualization::rendering::MaterialRecord'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.mesh_color_option. : Invalid expression 'open3d::visualization::RenderOption::MeshColorOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.mesh_color_option. : Invalid expression 'open3d::visualization::RenderOption::MeshColorOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.mesh_shade_option. : Invalid expression 'open3d::visualization::RenderOption::MeshShadeOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.mesh_shade_option. : Invalid expression 'open3d::visualization::RenderOption::MeshShadeOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.point_color_option. : Invalid expression 'open3d::visualization::RenderOption::PointColorOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.RenderOption.point_color_option. : Invalid expression 'open3d::visualization::RenderOption::PointColorOption'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.VisualizerWithVertexSelection.get_picked_points : Invalid expression 'open3d::visualization::VisualizerWithVertexSelection::PickedPoint'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Application.add_window : Invalid expression 'open3d::visualization::gui::Window'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Application.create_window : Invalid expression 'open3d::visualization::gui::PyWindow'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Application.menubar. : Invalid expression 'open3d::visualization::gui::Menu'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Application.menubar. : Invalid expression 'open3d::visualization::gui::Menu'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Application.post_to_main_thread : Invalid expression 'open3d::visualization::gui::Window'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.CollapsableVert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910ec70f0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.CollapsableVert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910f51170>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.FontDescription.__init__ : Invalid expression '<FontStyle.NORMAL: 0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Horiz.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910f67570>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Horiz.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910f0c130>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.LayoutContext.theme. : Invalid expression 'open3d::visualization::gui::Theme'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.ScrollableVert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa913746530>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.ScrollableVert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910ee78f0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.VGrid.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa94402b630>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.VGrid.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910ebe630>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Vert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa9440558f0>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Vert.__init__ : Invalid expression '<open3d.cpu.pybind.visualization.gui.Margins object at 0x7fa910f47230>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.add_child : Invalid expression 'open3d::visualization::gui::Widget'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.content_rect. : Invalid expression 'open3d::visualization::gui::Rect'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.os_frame. : Invalid expression 'open3d::visualization::gui::Rect'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.os_frame. : Invalid expression 'open3d::visualization::gui::Rect'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.set_focus_widget : Invalid expression 'open3d::visualization::gui::Widget'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.show_dialog : Invalid expression 'open3d::visualization::gui::Dialog'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.size. : Invalid expression 'open3d::visualization::gui::Size'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.size. : Invalid expression 'open3d::visualization::gui::Size'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.gui.Window.theme. : Invalid expression 'open3d::visualization::gui::Theme'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.rendering.OffscreenRenderer.scene. : Invalid expression 'open3d::visualization::rendering::Open3DScene'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.rendering.Renderer.add_texture : Invalid expression 'open3d::visualization::rendering::REHandle<(open3d::visualization::rendering::EntityType)10>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.rendering.Renderer.remove_texture : Invalid expression 'open3d::visualization::rendering::REHandle<(open3d::visualization::rendering::EntityType)10>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.rendering.Renderer.update_texture : Invalid expression 'open3d::visualization::rendering::REHandle<(open3d::visualization::rendering::EntityType)10>'
pybind11_stubgen - [  ERROR] In open3d.cpu.pybind.visualization.rendering.View.set_shadowing : Invalid expression '<ShadowType.PCF: 0>'
pybind11_stubgen - [WARNING] Enum-like str representations were found with no matching mapping to the enum class location.
Use `--enum-class-locations` to specify full path to the following enum(s):
 - ShadowType
 - InterpType
 - RobustKernelMethod
 - FontStyle
pybind11_stubgen - [WARNING] Raw C++ types/values were found in signatures extracted from docstrings.
Please check the corresponding sections of pybind11 documentation to avoid common mistakes in binding code:
 - https://pybind11.readthedocs.io/en/latest/advanced/misc.html#avoiding-cpp-types-in-docstrings
 - https://pybind11.readthedocs.io/en/latest/advanced/functions.html#default-arguments-revisited

Expected behavior

I would expect the python documentation and stubs generated using pybind11-stubgen to only contain python types and no c++ types.

Open3D, Python and System information

Should be a system independent issue, but here are my stats anyway:
- Operating system: Ubuntu 22.04
- Python version: 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0]
- Open3D version: 0.18.0/main
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 11.4.0

Additional information

No response

@timohl timohl added the bug Not a build issue, this is likely a bug. label Jul 14, 2024
@timohl
Copy link
Contributor Author

timohl commented Jul 14, 2024

I am currently working on splitting the pybind declarations and definitions to solve this: #6869.
(Sorry for the double pull request. There was no option to change to draft after I accidentally opened it)

ssheorey pushed a commit that referenced this issue Aug 14, 2024
As explained in #6867 there are several instances where C++ types are shown in the Python binding documentation.
Some of those instances can be solved by splitting the py::_class and py::enum_ declarations from the method/function definitions using .def(...).
This ensures, that all types are properly declared before usage.
---------
Co-authored-by: Sameer Sheorey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
1 participant