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

Python code cleanup #43

Merged
merged 2 commits into from
May 10, 2016
Merged

Python code cleanup #43

merged 2 commits into from
May 10, 2016

Conversation

ablakey
Copy link
Contributor

@ablakey ablakey commented Jan 16, 2016

This PR represents a significant step toward cleaning up the Python implementation of actionlib. I focused on removing unused imports, removing semicolons, spacing, indentation.

I did not clean up line lengths.

I did not clean up any of the docstrings as I don't have experience with Doxygen and don't want to break anything.

@mikepurvis
Copy link
Member

This seems reasonable to me— doesn't look like there are any significant public forks, so I don't see there being major merge issues with it. Is there development you're wanting to do on actionlib which is made easier by having the package style updated?

@mikaelarguedas What are your thoughts, as new maintainer?

@ablakey
Copy link
Contributor Author

ablakey commented Mar 21, 2016

The goal is to give the package a more consistent style. I found a lot of the logic to be difficult to follow when studying the threading lock use, for example. Not trying to be a PEP8 pedant, but as far as I could tell, there was no consistent style.

More generally speaking, we're investigating opportunities to improve the library's behaviour when used in contexts with a lot of threading and/or inconsistent networking situations.

Hopefully this PR will make it easier to study and maintain actionlib's Python implementation to be worth the cost of a considerable hit to the blame history, mutation from the original, etc.

@mikaelarguedas
Copy link
Member

It looks good to me. thanks @ablakey for homogenizing the style!
I'm surprised that the test has been labelled as flaky on the Kinetic buildfarm.
As soon as the tests pass it don't see any reason not to merge it.

## Updates the statuses of all goals from the information in status_array.
##
## @param status_array (\c actionlib_msgs/GoalStatusArray)
def update_statuses(self, status_array):
live_statuses = []
live_statuses = [] # TODO: unused local var.
Copy link
Member

Choose a reason for hiding this comment

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

This line can safely be removed.

@ablakey
Copy link
Contributor Author

ablakey commented Mar 21, 2016

@mikaelarguedas I'm not sure why the test isn't passing. The tests for the Python implementation pass on my local machine. Is this something I need to explore further or an oddity of the buildfarm?

@mikaelarguedas
Copy link
Member

given that the tests passed on jade for ubuntu 14.04 I don't think there is anything wrong on your side. We''l have to investigate on our hand to see why it's not passing on 16.04

@ablakey
Copy link
Contributor Author

ablakey commented Apr 28, 2016

Are we in a holding pattern for something else to be resolved, or is there something we can do to move forward on this PR?

I'm prodding the unit tests that don't seem to pass, but I'm hesitant to base branches off branches of forks and go too far down that path. =) Though this isn't explicitly blocking.

@mikaelarguedas
Copy link
Member

Sorry because it was only a cleanup it went low on my priority list. I'll investigate the test failure on Kinetic shortly and will let you know once we're good to move forward.

@mikaelarguedas
Copy link
Member

@ros-pull-request-builder retest this please

@mikaelarguedas
Copy link
Member

It seems that it was due to a bug on the buildfarm which has been fixed since. Thanks for your work and your patience!

@mikaelarguedas mikaelarguedas merged commit da39083 into ros:indigo-devel May 10, 2016
stonier added a commit to stonier/actionlib that referenced this pull request Sep 26, 2016
This was introduced in ros#43.

It is not actually correct - you can feasibly get feedback here before a new goal is confirmed. See `send_goal()`....

```
    def send_goal(self, goal, done_cb=None, active_cb=None, feedback_cb=None):
        # destroys the old goal handle
        self.stop_tracking_goal()

        ...

        self.gh = self.action_client.send_goal(goal, self._handle_transition, self._handle_feedback)
```
and of course it will take more time on top of this for the server to actually process the incoming goal and confirm it. Meantime, it may have sent us feedback messages.
mikaelarguedas added a commit that referenced this pull request Mar 27, 2017
* trailing wwhitespace, semicolons and blank lines

* fix star imports violations

* fix typos + type errors

* more whitespace / comment fixup

* python 3 compatibility

* more star imports

* remove unused imports

* use isinstance

* add todo for SimpleAction test files

* alphabetize new import
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

4 participants