Skip to content

Commit 6964886

Browse files
committed
Change names of superclasses to be consistent and standard
now BasePoseList, BasePoseMatrix and BaseTwist
1 parent 32b6bbc commit 6964886

14 files changed

Lines changed: 65 additions & 48 deletions

‎spatialmath/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from spatialmath.pose2d import SO2, SE2
22
from spatialmath.pose3d import SO3, SE3
3-
from spatialmath.super_pose import SMPose
3+
from spatialmath.baseposematrix import BasePoseMatrix
44
from spatialmath.geom3d import Plucker, Plane
55
from spatialmath.twist import Twist3, Twist2
66
from spatialmath.spatialvector import SpatialVelocity, SpatialAcceleration, \
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66
from spatialmath.base import base
7-
from spatialmath.smuserlist import SMUserList
7+
from spatialmath.baseposelist import BasePoseList
88
from spatialmath.base import symbolic as sym
99

1010
_eps = np.finfo(np.float64).eps
@@ -28,7 +28,7 @@
2828
_ANSIMatrix = False
2929

3030

31-
class SMPose(SMUserList):
31+
class BasePoseMatrix(BasePoseList):
3232
"""
3333
Superclass for SO(N) and SE(N) objects
3434
@@ -117,7 +117,7 @@ def __new__(cls, *args, **kwargs):
117117
``UserList`` capabilities.
118118
"""
119119

120-
pose = super(SMPose, cls).__new__(cls) # create a new instance
120+
pose = super(BasePoseMatrix, cls).__new__(cls) # create a new instance
121121
super().__init__(pose) # initialize UserList
122122
return pose
123123

‎spatialmath/geom3d.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import matplotlib.pyplot as plt
99
import spatialmath.base as base
1010
from spatialmath import SE3
11-
from spatialmath.smuserlist import SMUserList
11+
from spatialmath.baseposelist import BasePoseList
1212

1313
_eps = np.finfo(np.float64).eps
1414

@@ -126,7 +126,7 @@ def __str__(self):
126126

127127
# ======================================================================== #
128128

129-
class Plucker(SMUserList):
129+
class Plucker(BasePoseList):
130130
"""
131131
Plucker coordinate class
132132

‎spatialmath/pose2d.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
from spatialmath.base import argcheck
2727
from spatialmath import base as tr
28-
from spatialmath.super_pose import SMPose
28+
from spatialmath.baseposematrix import BasePoseMatrix
2929
import spatialmath.pose3d as p3
3030

3131
# ============================== SO2 =====================================#
3232

3333

34-
class SO2(SMPose):
34+
class SO2(BasePoseMatrix):
3535
"""
3636
SO(2) matrix class
3737

‎spatialmath/pose3d.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
import numpy as np
2727

2828
from spatialmath import base
29-
from spatialmath.super_pose import SMPose
29+
from spatialmath.baseposematrix import BasePoseMatrix
3030

3131

3232
# ============================== SO3 =====================================#
3333

3434

35-
class SO3(SMPose):
35+
class SO3(BasePoseMatrix):
3636
"""
3737
SO(3) matrix class
3838

‎spatialmath/quaternion.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
from typing import Any, Type
2121
from spatialmath import base
2222
from spatialmath.pose3d import SO3, SE3
23-
from spatialmath.smuserlist import SMUserList
23+
from spatialmath.baseposelist import BasePoseList
2424

2525
_eps = np.finfo(np.float64).eps
2626

27-
class Quaternion(SMUserList):
27+
class Quaternion(BasePoseList):
2828
r"""
2929
Quaternion class
3030

‎spatialmath/spatialvector.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
from abc import abstractmethod
1818
import numpy as np
19-
from spatialmath.smuserlist import SMUserList
19+
from spatialmath.baseposelist import BasePoseList
2020
from spatialmath import base
2121
from spatialmath.pose3d import SE3
2222
from spatialmath.twist import Twist3
2323

24-
class SpatialVector(SMUserList):
24+
class SpatialVector(BasePoseList):
2525
"""
2626
Spatial 6-vector abstract superclass
2727
@@ -467,7 +467,7 @@ def __init__(self, value=None):
467467

468468
# ------------------------------------------------------------------------- #
469469

470-
class SpatialInertia(SMUserList):
470+
class SpatialInertia(BasePoseList):
471471
"""
472472
Spatial inertia class
473473

‎spatialmath/twist.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from spatialmath.pose2d import SE2
99
from spatialmath.geom3d import Plucker
1010
import spatialmath.base as base
11-
from spatialmath.smuserlist import SMUserList
11+
from spatialmath.baseposelist import BasePoseList
1212

13-
class SMTwist(SMUserList):
13+
class BaseTwist(BasePoseList):
1414
"""
1515
Superclass for 3D and 2D twist objects
1616
@@ -303,7 +303,7 @@ def __ne__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argu
303303
# ======================================================================== #
304304

305305

306-
class Twist3(SMTwist):
306+
class Twist3(BaseTwist):
307307
r"""
308308
3D twist class
309309
@@ -1072,7 +1072,7 @@ def _repr_pretty_(self, p, cycle):
10721072

10731073
# ======================================================================== #
10741074

1075-
class Twist2(SMTwist):
1075+
class Twist2(BaseTwist):
10761076

10771077
def __init__(self, arg=None, w=None, check=True):
10781078
r"""
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import unittest
22
import numpy as np
3-
from spatialmath.smuserlist import SMUserList
3+
from spatialmath.baseposelist import BasePoseList
44

55
# create a subclass to test with, its value is a scalar
6-
class X(SMUserList):
7-
def __init__(self, value=0):
6+
class X(BasePoseList):
7+
def __init__(self, value=0, check=False):
88
super().__init__()
99
self.data = [value]
1010

@@ -20,7 +20,7 @@ def shape(self):
2020
def isvalid(x):
2121
return True
2222

23-
class TestSMUserList(unittest.TestCase):
23+
class TestBasePoseList(unittest.TestCase):
2424

2525
def test_constructor(self):
2626

0 commit comments

Comments
 (0)