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

PEP 585 compliance #112

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dynamic_stack_decider/dynamic_stack_decider/dsd.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
import sys
import traceback
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from typing import Optional

from rclpy.node import Node
from rclpy.qos import DurabilityPolicy, QoSProfile
@@ -26,7 +26,7 @@
)


def discover_elements(path: str) -> Dict[str, AbstractStackElement]:
def discover_elements(path: str) -> dict[str, AbstractStackElement]:
"""
Extract all the classes from the files in the given path and return a dictionary containing them

@@ -122,10 +122,10 @@ def __init__(self, blackboard, debug_topic: str = None, node: Optional[Node] = N
self.tree: Optional[Tree] = None
# The stack is implemented as a list of tuples consisting of the tree element
# and the actual module instance
self.stack: List[Tuple[AbstractTreeElement, AbstractStackElement]] = []
self.stack: list[tuple[AbstractTreeElement, AbstractStackElement]] = []

self.actions: Dict[str, AbstractActionElement] = {}
self.decisions: Dict[str, AbstractDecisionElement] = {}
self.actions: dict[str, AbstractActionElement] = {}
self.decisions: dict[str, AbstractDecisionElement] = {}

# Check if debugging is active
self.debug_active = debug_topic is not None
2 changes: 1 addition & 1 deletion dynamic_stack_decider/dynamic_stack_decider/parser.py
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ def _create_sequence_element(self, actions, parent, lnr):
Create a new sequence element

:param actions: The names of actions in the sequence
:type actions: List[str]
:type actions: list[str]
:param parent: The parent element of the sequence
:type parent: AbstractDecisionElement
:param lnr: Line number of the current line (used for error messages)