Skip to content

Commit

Permalink
Add docs for users to create stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Aug 14, 2024
1 parent 11ce1bb commit 71cedf8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/builddocs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,22 @@ Open ``docs/_out/html/index.html`` in a web browser to preview the docs.
.. code-block:: bash
google-chrome docs/_out/html/index.html
Create Python stubs (type hints) for type checking and autocomplete
-------------------------------------------------------------------

You can get type checking and auto-complete features in editors and IDES (e.g.
VS Code, PyCharm, etc.) using type hints produced from Open3D. These can be
created with the pybind11-stubgen tool and placed alongside the Open3D files:

.. code-block:: bash
# Install open3d and pybind11-stubgen
pip install pybind11-stubgen open3d
# Print location of install open3d library
pip show open3d
# This outputs a line like:
# Location: path/to/venv/site-packages
# Create stubs and place them next to Open3D files
pybind11-stubgen -o <path/to/venv/site-packages/> --root-suffix "" open3d
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_fgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import sys
import numpy as np
import open3d as o3d

pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pyexample_path)
Expand Down
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import sys
import pickle
import open3d as o3d

pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pyexample_path)
Expand Down
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_ransac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import sys
import numpy as np
import open3d as o3d

pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pyexample_path)
Expand Down
2 changes: 1 addition & 1 deletion examples/python/benchmark/benchmark_tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# SPDX-License-Identifier: MIT
# ----------------------------------------------------------------------------

import open3d as o3d
import numpy as np
import time
import os
import sys
import open3d as o3d

pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pyexample_path)
Expand Down

0 comments on commit 71cedf8

Please sign in to comment.