diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index c3afd0bed..c7fbbbb85 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -168,8 +168,8 @@ class Orientation(Rotation,Crystal): return np.logical_not(self==other) if isinstance(other, Orientation) else NotImplemented - def isclose(self, - other: object, + def isclose(self: MyType, + other: MyType, rtol: float = 1e-5, atol: float = 1e-8, equal_nan: bool = True) -> bool: @@ -193,8 +193,6 @@ class Orientation(Rotation,Crystal): Mask indicating where corresponding orientations are close. """ - if not isinstance(other, Orientation): - raise TypeError matching_type = self.family == other.family and \ self.lattice == other.lattice and \ self.parameters == other.parameters @@ -202,8 +200,8 @@ class Orientation(Rotation,Crystal): - def allclose(self, - other: object, + def allclose(self: MyType, + other: MyType, rtol: float = 1e-5, atol: float = 1e-8, equal_nan: bool = True) -> bool: diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index b11147482..9c6bde2dc 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -140,8 +140,8 @@ class Rotation: """ return np.logical_not(self==other) if isinstance(other, Rotation) else NotImplemented - def isclose(self, - other: 'Rotation', + def isclose(self: MyType, + other: MyType, rtol: float = 1e-5, atol: float = 1e-8, equal_nan: bool = True) -> bool: @@ -171,8 +171,8 @@ class Rotation: np.all(np.isclose(s,-1.0*o,rtol,atol,equal_nan),axis=-1)) - def allclose(self, - other: 'Rotation', + def allclose(self: MyType, + other: MyType, rtol: float = 1e-5, atol: float = 1e-8, equal_nan: bool = True) -> Union[np.bool_, bool]: