Skip to content

Commit 48ead9e

Browse files
committed
Added return types to key methods
1 parent 2c767e2 commit 48ead9e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spatialmath/base/argcheck.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
# pylint: disable=invalid-name
1313

1414
import math
15+
from typing import Union
1516
import numpy as np
1617
from spatialmath.base import symbolic as sym
17-
from numpy.typing import ArrayLike
1818

1919
# valid scalar types
2020
_scalartypes = (int, np.integer, float, np.floating) + sym.symtype
2121

22+
ArrayLike = Union[list, np.ndarray, tuple, set]
2223

2324
def isscalar(x):
2425
"""
@@ -452,7 +453,7 @@ def isvector(v, dim=None):
452453
return False
453454

454455

455-
def getunit(v, unit="rad"):
456+
def getunit(v, unit="rad") -> ArrayLike:
456457
"""
457458
Convert value according to angular units
458459

spatialmath/baseposelist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def _A(self):
256256
return self.data
257257

258258
@property
259-
def A(self):
259+
def A(self) -> np.ndarray:
260260
"""
261261
Array value of an instance (BasePoseList superclass method)
262262

0 commit comments

Comments
 (0)