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

Add missing keyword arg names to visualization bindings #6407

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

djkeyes
Copy link
Contributor

@djkeyes djkeyes commented Oct 4, 2023

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes #
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

I was using the python visualization API, and I noticed that some of the keyword arguments in the python bindings show up as "arg0" "arg1" etc. This made it confusing, because I had to keep switching between the python API and the source code to see what the arguments really meant. This adds the missing argument names.

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

Before, if I ran something like help(open3d.visualization.Visualizer.reset_view_point), I would get a message that looks like this (notice the arg0):

Help on instancemethod in module open3d.cpu.pybind.visualization:

reset_view_point(...)
    reset_view_point(self, arg0)
    Function to reset view point
    
    Args:
        arg0 (bool)
    
    Returns:
        None

Now it looks like this:

Help on instancemethod in module open3d.cpu.pybind.visualization:

reset_view_point(...)
    reset_view_point(self, reset_bounding_box=False)
    Function to reset view point
    
    Args:
        reset_bounding_box (bool, optional, default=False): Set to ``False`` to keep current viewpoint
    
    Returns:
        None

I have added similar fixes for other functions in open3d.visualization. I believe this is the only module where the keyword arguments were missing in the python docs. In O3DVisualizer, some of the documentation style was inconsistent, so I cleaned that up, too.

I checked the generated html docs and verified that the results look okay. Let me know if you'd like any other changes.


This change is Reviewable

@update-docs
Copy link

update-docs bot commented Oct 4, 2023

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey requested a review from errissa October 6, 2023 04:41
@ssheorey ssheorey self-requested a review December 26, 2023 15:50
Copy link
Member

@ssheorey ssheorey left a comment

Choose a reason for hiding this comment

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

Thanks @djkeyes for this very useful update!

@ssheorey ssheorey merged commit f2285b6 into isl-org:main Dec 26, 2023
35 of 36 checks passed
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.

2 participants