Skip to content

implement Action conditions#121

Merged
wjwwood merged 6 commits intomasterfrom
feature/action_conditions
Jul 27, 2018
Merged

implement Action conditions#121
wjwwood merged 6 commits intomasterfrom
feature/action_conditions

Conversation

@wjwwood
Copy link
Copy Markdown
Member

@wjwwood wjwwood commented Jul 25, 2018

This fixes #105 by adding a Condition class, making Actions take them and evaluate them as the predicate for "executing" the action, and adding the IfCondition and UnlessCondition classes which can operate on Substitution classes.

See #105 for more design details and conceptual information. The idea that actions can be conditionally executed with a Condition is also in the architecture document (in the doc folder).

@wjwwood wjwwood added the in review Waiting for review (Kanban column) label Jul 25, 2018
@wjwwood wjwwood self-assigned this Jul 25, 2018
@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Jul 25, 2018

CI (launch and launch_ros only):

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

@sloretz sloretz added in progress Actively being worked on (Kanban column) in review Waiting for review (Kanban column) and removed in review Waiting for review (Kanban column) in progress Actively being worked on (Kanban column) labels Jul 26, 2018
@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Jul 26, 2018

New CI after fixing flake8 issue:

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

@mjcarroll
Copy link
Copy Markdown
Member

This is the first time I've seem PEP484 in the wild, pretty nifty.

Copy link
Copy Markdown
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

One minor Q, but looks good.

Is there an example of a launch file using this? Am I just missing it?

from typing import List
from typing import Optional
from typing import Text
from typing import Tuple # noqa: F401
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is F401 needed here, looks like you are using Tuple?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because we have to support python 3.5, we cannot use the type annotation for member variables syntax which was added in 3.6. So we use the type comment, which is the only place I use Tuple. So flake8 doesn’t count that as using it so I suppressed the unused import warning.

@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Jul 27, 2018

There is no example using it yet. I have a couple of related features (all part of “include another launch file into a namespace”) which I wanted to finish before updating or adding new examples.

@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Jul 27, 2018

I really like the type annotations. I would not use them everywhere but I caught at least ten to fifteen errors while writing the code before even running my tests.

@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Jul 27, 2018

Would not*

@wjwwood wjwwood merged commit f32662a into master Jul 27, 2018
@wjwwood wjwwood removed the in review Waiting for review (Kanban column) label Jul 27, 2018
@wjwwood wjwwood deleted the feature/action_conditions branch July 27, 2018 21:20
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.

[launch] add concept of Conditions

3 participants