Skip to content

Commit efa4d84

Browse files
authored
Merge pull request #18 from ros-sports/typing/PEP585_compliance
PEP585 compliance
2 parents 3cea93e + d3bc2c4 commit efa4d84

File tree

5 files changed

+12
-20
lines changed

5 files changed

+12
-20
lines changed

soccer_ipm/soccer_ipm/msgs/goalpost.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Tuple
16-
1715
from ipm_library.exceptions import NoIntersectionError
1816
from ipm_library.ipm import IPM
1917
from rclpy.impl.rcutils_logger import RcutilsLogger
@@ -28,7 +26,7 @@ def map_goalpost_array(
2826
output_frame: str,
2927
logger: RcutilsLogger,
3028
footpoint_out_of_image_threshold: float,
31-
object_default_dimensions: Tuple[float, float, float]) -> sv3dm.GoalpostArray:
29+
object_default_dimensions: tuple[float, float, float]) -> sv3dm.GoalpostArray:
3230
"""
3331
Map a given array of 2D goal post detections onto the field plane.
3432

soccer_ipm/soccer_ipm/msgs/markings.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import List
16-
1715
from geometry_msgs.msg import Vector3
1816
from ipm_library.exceptions import NoIntersectionError
1917
from ipm_library.ipm import IPM
@@ -66,10 +64,10 @@ def map_marking_array(
6664

6765
def map_marking_intersections(
6866
header: Header,
69-
intersections_2d: List[sv2dm.MarkingIntersection],
67+
intersections_2d: list[sv2dm.MarkingIntersection],
7068
ipm: IPM,
7169
output_frame: str,
72-
logger: RcutilsLogger) -> List[sv3dm.MarkingIntersection]:
70+
logger: RcutilsLogger) -> list[sv3dm.MarkingIntersection]:
7371
"""
7472
Map a given list of 2D field marking intersections onto the field plane.
7573
@@ -132,10 +130,10 @@ def map_marking_intersections(
132130

133131
def map_marking_segments(
134132
header: Header,
135-
marking_segments_2d: List[sv2dm.MarkingSegment],
133+
marking_segments_2d: list[sv2dm.MarkingSegment],
136134
ipm: IPM,
137135
output_frame: str,
138-
logger: RcutilsLogger) -> List[sv3dm.MarkingSegment]:
136+
logger: RcutilsLogger) -> list[sv3dm.MarkingSegment]:
139137
"""
140138
Map a given list of 2D field marking segments onto the field plane.
141139
@@ -187,10 +185,10 @@ def map_marking_segments(
187185

188186
def map_marking_ellipses(
189187
header: Header,
190-
ellipses_2d: List[sv2dm.MarkingEllipse],
188+
ellipses_2d: list[sv2dm.MarkingEllipse],
191189
ipm: IPM,
192190
output_frame: str,
193-
logger: RcutilsLogger) -> List[sv3dm.MarkingEllipse]:
191+
logger: RcutilsLogger) -> list[sv3dm.MarkingEllipse]:
194192
"""
195193
Map a given list of 2D field marking ellipses onto the field plane.
196194

soccer_ipm/soccer_ipm/msgs/obstacles.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Tuple
16-
1715
from ipm_library.exceptions import NoIntersectionError
1816
from ipm_library.ipm import IPM
1917
from rclpy.impl.rcutils_logger import RcutilsLogger
@@ -28,7 +26,7 @@ def map_obstacle_array(
2826
output_frame: str,
2927
logger: RcutilsLogger,
3028
footpoint_out_of_image_threshold: float,
31-
object_default_dimensions: Tuple[float, float, float]) -> sv3dm.ObstacleArray:
29+
object_default_dimensions: tuple[float, float, float]) -> sv3dm.ObstacleArray:
3230
"""
3331
Map a given array of 2D obstacle detections onto the field plane.
3432

soccer_ipm/soccer_ipm/msgs/robots.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Tuple
16-
1715
from ipm_library.exceptions import NoIntersectionError
1816
from ipm_library.ipm import IPM
1917
from rclpy.impl.rcutils_logger import RcutilsLogger
@@ -28,7 +26,7 @@ def map_robot_array(
2826
output_frame: str,
2927
logger: RcutilsLogger,
3028
footpoint_out_of_image_threshold: float,
31-
object_default_dimensions: Tuple[float, float, float]) -> sv3dm.RobotArray:
29+
object_default_dimensions: tuple[float, float, float]) -> sv3dm.RobotArray:
3230
"""
3331
Map a given array of 2D robot detections onto the field plane.
3432

soccer_ipm/test/test_ipm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import math
16-
from typing import List, Optional, Tuple, Union
16+
from typing import Optional, Union
1717

1818
from geometry_msgs.msg import TransformStamped
1919
import numpy as np
@@ -67,7 +67,7 @@ def standard_ipm_test_case(
6767
input_topic: str,
6868
input_msg: SV2DARR,
6969
output_msg_type: type,
70-
output_topic: str) -> Tuple[SV3DARR, SV2DARR]:
70+
output_topic: str) -> tuple[SV3DARR, SV2DARR]:
7171
# Init ros
7272
rclpy.init()
7373
# Create IPM node
@@ -83,7 +83,7 @@ def standard_ipm_test_case(
8383
TFMessage, 'tf', 10)
8484

8585
# Create a shared reference to the recived message in the local scope
86-
received_msg: List[Optional[output_msg_type]] = [None]
86+
received_msg: list[Optional[output_msg_type]] = [None]
8787

8888
# Create a callback with sets this reference
8989
def callback(msg):

0 commit comments

Comments
 (0)