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

Docstring specifying proper destruction and creation of Rate, Timer and GuardCondition #1286

Merged
merged 8 commits into from
Jun 14, 2024

Conversation

hubble14567
Copy link
Contributor

This commit stems from my issue and discussion here

I added explanation of how the user should handle the destruction and creation of the object in the docstrings of the:

  • constructor of Rate, Timer and GuardCondition
  • .destroy methods of Rate, Timer and GuardCondition
  • .create_rate and .create_guard_condition methods of Node

Subscriber, Publisher and other objects share the same destruction process. However they already had proper warnings in their docstrings. So no changes were required for those. I have kept my new docstring consistent with those.

I have decided to only change .create_rate and .create_guard_condition methods of Node because, those are the most likely objects to be destroyed and had a very short docstrings. Adding the warning in the already long create_publisher, etc, did not seem right.

@hubble14567
Copy link
Contributor Author

I wonder if I should also add this to Iron and humble branch?

Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

lgtm with indent fixes.

rclpy/rclpy/guard_condition.py Outdated Show resolved Hide resolved
rclpy/rclpy/node.py Outdated Show resolved Hide resolved
hubble14567 and others added 2 commits May 21, 2024 11:07
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Elian NEPPEL <70491689+hubble14567@users.noreply.github.com>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Elian NEPPEL <70491689+hubble14567@users.noreply.github.com>
@hubble14567
Copy link
Contributor Author

lgtm, indeed better this way.

This reverts commit fd61446.

Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
This reverts commit 0fb83ca.

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: elian-WSL22H <elian.neppel@posteo.eu>
@hubble14567
Copy link
Contributor Author

Ok I don't know why the tests failed on fd61446, anyway they passed.

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

Thank you for the docstring improvements!

@sloretz
Copy link
Contributor

sloretz commented Jun 14, 2024

CI (repos file build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@sloretz sloretz merged commit 0926b34 into ros2:rolling Jun 14, 2024
3 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.

None yet

3 participants