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

Fix log error message for "probability" argument validation in PointCloud::SegmentPlane #6622

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

true-real-michael
Copy link
Contributor

@true-real-michael true-real-michael commented Jan 24, 2024

Corrected the error message in cpp/open3d/geometry/PointCloudSegmentation.cpp:PointCloud::SegmentPlane.
The probability argument is expected to be between 0 and 1, however log error message does not clearly reflect that.

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

Incorrect error message can cause confusion during debugging.
This PR fixes the incorrect error message.

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

Argument probability of this function is expected to be between 0 and 1, however if the argument did not satisfy this, the log error message previously read "Probability must be > 0 or <= 1.0" whereas it should be "Probability must be > 0 and <= 1.0". The message now accurately reflects the expected value for probability argument.

Corrected the error message in "cpp/open3d/geometry/PointCloudSegmentation.cpp:PointCloud::SegmentPlane".
The message previously read "Probability must be > 0 **or** <= 1.0" whereas it should be "Probability must be > 0 **and** <= 1.0".
The message now accurately reflects the expected value for "probability" argument.
Copy link

update-docs bot commented Jan 24, 2024

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

@true-real-michael true-real-michael changed the title Fix log error message for "probability" argument validation Fix log error message for "probability" argument validation in PointCloud::SegmentPlane Jan 24, 2024
@ssheorey ssheorey merged commit 72746b9 into isl-org:main Mar 7, 2024
26 of 29 checks passed
@true-real-michael true-real-michael deleted the fix-log-error-message branch March 8, 2024 07:47
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