restored type hints

for some strange reason, ignore is needed for damask.Crystal.__eq__
This commit is contained in:
Martin Diehl 2023-11-07 11:32:40 +01:00
parent fbfe2affb7
commit b332fd2b30
3 changed files with 8 additions and 3 deletions

View File

@ -547,7 +547,7 @@ class Crystal():
def __eq__(self, def __eq__(self,
other): other: object) -> bool:
""" """
Return self==other. Return self==other.
@ -562,7 +562,7 @@ class Crystal():
return (NotImplemented if not isinstance(other, Crystal) else return (NotImplemented if not isinstance(other, Crystal) else
self.lattice == other.lattice and self.lattice == other.lattice and
self.parameters == other.parameters and self.parameters == other.parameters and
self.family == other.family) self.family == other.family) # type: ignore
@property @property
def parameters(self) -> Optional[Tuple]: def parameters(self) -> Optional[Tuple]:

View File

@ -122,7 +122,7 @@ class Orientation(Rotation,Crystal):
def __eq__(self, def __eq__(self,
other: Union[object,MyType]) -> bool: other: object) -> bool:
""" """
Return self==other. Return self==other.

View File

@ -57,6 +57,11 @@ class Table:
Test equality of other. Test equality of other.
Parameters
----------
other : Table
Table to check for equality.
""" """
return NotImplemented if not isinstance(other,Table) else \ return NotImplemented if not isinstance(other,Table) else \
self.shapes == other.shapes and self.data.equals(other.data) self.shapes == other.shapes and self.data.equals(other.data)