__ne__ is automatically set to !__eq__, __neq__ has no special meaning
This commit is contained in:
parent
51e5dda702
commit
15af12bbb4
|
@ -107,22 +107,6 @@ class Rotation:
|
||||||
and np.allclose(self.quaternion,other.quaternion)
|
and np.allclose(self.quaternion,other.quaternion)
|
||||||
|
|
||||||
|
|
||||||
def __neq__(self,other):
|
|
||||||
"""
|
|
||||||
Not Equal to other.
|
|
||||||
|
|
||||||
Equality is determined taking limited floating point precision into
|
|
||||||
account. See numpy.allclose for details.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
other : Rotation
|
|
||||||
Rotation to check for inequality.
|
|
||||||
|
|
||||||
"""
|
|
||||||
return not self.__eq__(other)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def shape(self):
|
def shape(self):
|
||||||
return self.quaternion.shape[:-1]
|
return self.quaternion.shape[:-1]
|
||||||
|
|
|
@ -769,15 +769,16 @@ class TestRotation:
|
||||||
|
|
||||||
@pytest.mark.parametrize('shape',[None,1,(4,4)])
|
@pytest.mark.parametrize('shape',[None,1,(4,4)])
|
||||||
def test_random(self,shape):
|
def test_random(self,shape):
|
||||||
Rotation.from_random(shape)
|
r = Rotation.from_random(shape)
|
||||||
|
if shape is None:
|
||||||
|
assert r.shape == ()
|
||||||
|
elif shape == 1:
|
||||||
|
assert r.shape == (1,)
|
||||||
|
else:
|
||||||
|
assert r.shape == shape
|
||||||
|
|
||||||
def test_equal(self):
|
def test_equal(self):
|
||||||
r = Rotation.from_random()
|
assert Rotation.from_random(seed=1) == Rotation.from_random(seed=1)
|
||||||
assert r == r
|
|
||||||
|
|
||||||
def test_unequal(self):
|
|
||||||
r = Rotation.from_random()
|
|
||||||
assert not (r != r)
|
|
||||||
|
|
||||||
def test_inversion(self):
|
def test_inversion(self):
|
||||||
r = Rotation.from_random()
|
r = Rotation.from_random()
|
||||||
|
|
Loading…
Reference in New Issue