Skip to content

Commit

Permalink
setting black formatter line length to 90
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Nov 3, 2024
1 parent 04e7ec3 commit 8dfc347
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- name: Black Formatter
uses: lgeiger/black-action@master
with:
args: ". --check --diff"
args: ". --check --diff --line-length 90"
4 changes: 1 addition & 3 deletions yasmin/yasmin/state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ def execute(self, blackboard: Blackboard) -> str:
f"Outcome '{outcome}' is not a state nor a state machine outcome"
)

raise RuntimeError(
f"Ending canceled state machine '{self}' with bad transition"
)
raise RuntimeError(f"Ending canceled state machine '{self}' with bad transition")

def cancel_state(self) -> None:
"""
Expand Down
4 changes: 1 addition & 3 deletions yasmin_demos/yasmin_demos/action_client_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ def create_goal_handler(self, blackboard: Blackboard) -> Fibonacci.Goal:
goal.order = blackboard["n"] # Retrieve the input value 'n' from the blackboard
return goal

def response_handler(
self, blackboard: Blackboard, response: Fibonacci.Result
) -> str:
def response_handler(self, blackboard: Blackboard, response: Fibonacci.Result) -> str:
"""
Handles the response from the Fibonacci action.
Expand Down
6 changes: 3 additions & 3 deletions yasmin_ros/yasmin_ros/action_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def __init__(
Parameters:
action_type (Type): The type of the action to be executed.
action_name (str): The name of the action to be executed.
create_goal_handler (Callable): A function that generates the goal.
create_goal_handler (Callable[[Blackboard], Any])): A function that generates the goal.
outcomes (Set[str], optional): Additional outcomes that this state can return.
result_handler (Callable, optional): A function to process the result of the action.
feedback_handler (Callable, optional): A function to process feedback from the action.
result_handler (Callable[[Blackboard, Any], str], optional): A function to process the result of the action.
feedback_handler (Callable[[Blackboard, Any], None], optional): A function to process feedback from the action.
node (Node, optional): The ROS 2 node to use. If None, uses the default YasminNode.
timeout (float, optional): Timeout duration for waiting for the action server.
Expand Down
2 changes: 1 addition & 1 deletion yasmin_ros/yasmin_ros/monitor_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
msg_type (Type): The type of message to be monitored.
topic_name (str): The name of the topic to subscribe to.
outcomes (Set[str]): The set of possible outcomes from the state.
monitor_handler (Callable): The function to call with the received messages.
monitor_handler (Callable[[Blackboard, Any], None]): The function to call with the received messages.
qos (Union[QoSProfile, int], optional): Quality of Service profile or depth.
msg_queue (int, optional): Maximum number of messages to store. Default is 10.
node (Node, optional): The ROS node to use. If None, a default node is created.
Expand Down
12 changes: 4 additions & 8 deletions yasmin_ros/yasmin_ros/service_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def __init__(
Parameters:
srv_type (Type): The type of the service.
srv_name (str): The name of the service to be called.
create_request_handler (Callable): A handler to create the request based on the blackboard data.
create_request_handler (Callable[[Blackboard], Any]): A handler to create the request based on the blackboard data.
outcomes (Set[str], optional): A set of additional outcomes for this state.
response_handler (Callable, optional): A handler to process the service response.
response_handler (Callable[[Blackboard, Any], str], optional): A handler to process the service response.
node (Node, optional): A ROS node instance; if None, a default instance is used.
timeout (float, optional): Timeout duration for waiting on the service.
Expand All @@ -68,9 +68,7 @@ def __init__(
"""

## A function that creates the service request.
self._create_request_handler: Callable[[Blackboard], Any] = (
create_request_handler
)
self._create_request_handler: Callable[[Blackboard], Any] = create_request_handler
## A function that processes the service response.
self._response_handler: Callable[[Blackboard, Any], str] = response_handler

Expand Down Expand Up @@ -132,9 +130,7 @@ def execute(self, blackboard: Blackboard) -> str:
return TIMEOUT

try:
self._node.get_logger().info(
f"Sending request to service '{self._srv_name}'"
)
self._node.get_logger().info(f"Sending request to service '{self._srv_name}'")
response = self._service_client.call(request)

except Exception as e:
Expand Down
4 changes: 1 addition & 3 deletions yasmin_viewer/yasmin_viewer/yasmin_viewer_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def start_backend_server(self) -> None:
"""
app = Flask(
"yasmin_viewer",
static_folder=ament_index_python.get_package_share_directory(
"yasmin_viewer"
)
static_folder=ament_index_python.get_package_share_directory("yasmin_viewer")
+ "/yasmin_viewer_web_client",
static_url_path="/",
)
Expand Down

0 comments on commit 8dfc347

Please sign in to comment.