compute_fpfh_feature stub incorrectly requires the optional indices argument
Checklist
- I have searched for similar issues.
- For Python issues, I have tested with the latest development wheel.
- I have checked the release documentation and the latest documentation (for
mainbranch).
Describe the issue
In Open3D 0.20.0, the bundled type stub for compute_fpfh_feature declares indices as a required argument, although the Python binding defaults it to None.
As a result, pyrefly reports missing-argument for a valid call that omits indices.
The annotation also does not allow None, so both the default value and the nullable type appear to be missing.
Steps to reproduce the bug
Run pyrefly on the following code:
import open3d as o3d
def compute_features(point_cloud: o3d.geometry.PointCloud):
return o3d.pipelines.registration.compute_fpfh_feature(
point_cloud,
o3d.geometry.KDTreeSearchParamHybrid(radius=0.25, max_nn=100),
)Error message
Pyrefly reports that the indices argument is missing.
The bundled open3d/pybind/pipelines/registration.pyi contains:
def compute_fpfh_feature(
input: open3d.pybind.geometry.PointCloud,
search_param: open3d.pybind.geometry.KDTreeSearchParam,
indices: collections.abc.Sequence[typing.SupportsInt],
) -> Feature:
...However, the Python binding declares "indices"_a = py::none():
https://github.com/isl-org/Open3D/blob/main/cpp/pybind/pipelines/registration/feature.cpp#L65-L67
PR #7118 introduced indices as an optional argument. When omitted, features are computed for the entire point cloud.
Expected behavior
The stub should reflect the runtime API, for example:
indices: collections.abc.Sequence[typing.SupportsInt] | None = NoneBoth omitting indices and explicitly passing indices=None should pass type checking.
Open3D, Python and System information
- Open3D: 0.20.0
- Python: 3.13
- Type checker: pyrefly
Additional information
AI generated issue.
Source: isl-org/Open3D