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

rename API of type objects #360

Merged
merged 2 commits into from
Apr 19, 2019
Merged

rename API of type objects #360

merged 2 commits into from
Apr 19, 2019

Conversation

dirk-thomas
Copy link
Member

The current state is not ready to be merged yet but I am looking for a review of the proposed changes. Once this is reviewed / approved I will start working on updating all message generators.

I will add some inline comments describing why I made some of the changes.

@dirk-thomas dirk-thomas added enhancement New feature or request in review Waiting for review (Kanban column) labels Apr 17, 2019
@dirk-thomas dirk-thomas self-assigned this Apr 17, 2019
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
"""
super().__init__()
self.namespaces = namespaces
self.name = name

def namespaced_name(self) -> Tuple[str, ...]:
return (*self.namespaces, self.name)
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this is used together in a lot of places providing the combination in a method makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

Depending on how this is used, consider making this a property, adding a little sugar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would lean towards keeping it a method so the caller sees what is actually an attribute and what is derived data. If others too think it should be a property I am happy to change it though.

rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
@sloretz sloretz self-requested a review April 18, 2019 16:19
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM

rosidl_parser/rosidl_parser/definition.py Outdated Show resolved Hide resolved
"""
super().__init__()
self.namespaces = namespaces
self.name = name

def namespaced_name(self) -> Tuple[str, ...]:
return (*self.namespaces, self.name)
Copy link
Member

Choose a reason for hiding this comment

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

Depending on how this is used, consider making this a property, adding a little sugar.

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.

Submitting as far as I got. LGTM! The docstrings are very helpful

rosidl_parser/rosidl_parser/definition.py Outdated Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Outdated Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Outdated Show resolved Hide resolved
rosidl_parser/rosidl_parser/definition.py Show resolved Hide resolved
@dirk-thomas
Copy link
Member Author

I (force) pushed a commit with all the feedback addressed. I squashed the changes to keep them separate from the next ones updating the code to use that modified API.

super().__init__()
# TODO(dirk-thomas) can't be enforced yet since the parser might pass a
# constant name
# assert maximum_size > 0
Copy link
Member Author

Choose a reason for hiding this comment

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

While I wanted to add this assert it turns out the value is currently also being used to temporary store a constant name during the parsing which gets replaced with the constant value shortly after.

I won't change this during this renaming but added a note to be aware of it.

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas
Copy link
Member Author

dirk-thomas commented Apr 18, 2019

Preliminary builds passed already so this is a set of lengthy builds with all three RMW impl. enabled:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

All the referenced PRs only update the naming and don't contain any other changes. I will create separate PRs to actually simplify the logic after this is merged.

@dirk-thomas
Copy link
Member Author

Please also review the changes of the second commit as well as the connected PRs which update the code base to use the renamed API.

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM pending green(ish) CI.

@dirk-thomas
Copy link
Member Author

As green(ish) as it gets these days (with a tint of yellow known to flaky or failing) 😉

@dirk-thomas dirk-thomas merged commit e45dffd into master Apr 19, 2019
@delete-merged-branch delete-merged-branch bot deleted the definition-api-review branch April 19, 2019 21:24
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants