Skip to content

Commit d7eb1b2

Browse files
committed
Fix remaining LGTM no-self alerts, the function signature cannot be split across multiple lines
1 parent ccf5661 commit d7eb1b2

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

spatialmath/spatialvector.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ def __neg__(self):
205205

206206
return self.__class__([-x for x in self.data])
207207

208-
def __add__(
209-
left, right # lgtm[py/not-named-self] pylint: disable=no-self-argument
210-
):
208+
def __add__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argument
211209
"""
212210
Overloaded ``*`` operator (superclass method)
213211
@@ -231,9 +229,7 @@ def __add__(
231229

232230
return left.__class__([x + y for x, y in zip(left.data, right.data)])
233231

234-
def __sub__(
235-
left, right # lgtm[py/not-named-self] pylint: disable=no-self-argument
236-
):
232+
def __sub__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argument
237233
"""
238234
Overloaded ``-`` operator (superclass method)
239235
@@ -256,9 +252,7 @@ def __sub__(
256252

257253
return left.__class__([x - y for x, y in zip(left.data, right.data)])
258254

259-
def __rmul__(
260-
right, left # lgtm[py/not-named-self] pylint: disable=no-self-argument
261-
):
255+
def __rmul__(right, left): # lgtm[py/not-named-self] pylint: disable=no-self-argument
262256
"""
263257
Overloaded ``*`` operator (superclass method)
264258
@@ -483,9 +477,7 @@ def __init__(self, value=None):
483477

484478
# n = SpatialForce(val);
485479

486-
def __rmul__(
487-
right, left # lgtm[py/not-named-self] pylint: disable=no-self-argument
488-
):
480+
def __rmul__(right, left): # lgtm[py/not-named-self] pylint: disable=no-self-argument
489481
# Twist * SpatialForce -> SpatialForce
490482
return SpatialForce(left.Ad().T @ right.A)
491483

@@ -618,9 +610,7 @@ def __repr__(self):
618610
def __str__(self):
619611
return str(self.A)
620612

621-
def __add__(
622-
left, right # lgtm[py/not-named-self] pylint: disable=no-self-argument
623-
):
613+
def __add__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argument
624614
"""
625615
Spatial inertia addition
626616
:param left:
@@ -635,9 +625,7 @@ def __add__(
635625
raise TypeError("can only add spatial inertia to spatial inertia")
636626
return SpatialInertia(left.I + left.I)
637627

638-
def __mul__(
639-
left, right # lgtm[py/not-named-self] pylint: disable=no-self-argument
640-
):
628+
def __mul__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argument
641629
"""
642630
Overloaded ``*`` operator (superclass method)
643631
@@ -661,9 +649,7 @@ def __mul__(
661649
else:
662650
raise TypeError("bad postmultiply operands for Inertia *")
663651

664-
def __rmul__(
665-
self, left # lgtm[py/not-named-self] pylint: disable=no-self-argument
666-
):
652+
def __rmul__(right, left): # lgtm[py/not-named-self] pylint: disable=no-self-argument
667653
"""
668654
Overloaded ``*`` operator (superclass method)
669655
@@ -677,7 +663,7 @@ def __rmul__(
677663
the SpatialAcceleration ``a``.
678664
- ``v * I`` is the SpatialMomemtum of a body with SpatialInertia ``I`` and SpatialVelocity ``v``.
679665
"""
680-
return self.__mul__(left)
666+
return right.__mul__(left)
681667

682668

683669
if __name__ == "__main__":

0 commit comments

Comments
 (0)