From b332fd2b30e0d7d9730d63f47a22ad9caac90941 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 7 Nov 2023 11:32:40 +0100 Subject: [PATCH] restored type hints for some strange reason, ignore is needed for damask.Crystal.__eq__ --- python/damask/_crystal.py | 4 ++-- python/damask/_orientation.py | 2 +- python/damask/_table.py | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/python/damask/_crystal.py b/python/damask/_crystal.py index 714427e24..e754a65f8 100644 --- a/python/damask/_crystal.py +++ b/python/damask/_crystal.py @@ -547,7 +547,7 @@ class Crystal(): def __eq__(self, - other): + other: object) -> bool: """ Return self==other. @@ -562,7 +562,7 @@ class Crystal(): return (NotImplemented if not isinstance(other, Crystal) else self.lattice == other.lattice and self.parameters == other.parameters and - self.family == other.family) + self.family == other.family) # type: ignore @property def parameters(self) -> Optional[Tuple]: diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index ca757166a..b28ba2aae 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -122,7 +122,7 @@ class Orientation(Rotation,Crystal): def __eq__(self, - other: Union[object,MyType]) -> bool: + other: object) -> bool: """ Return self==other. diff --git a/python/damask/_table.py b/python/damask/_table.py index ac19f761a..9608f0d13 100644 --- a/python/damask/_table.py +++ b/python/damask/_table.py @@ -57,6 +57,11 @@ class Table: Test equality of other. + Parameters + ---------- + other : Table + Table to check for equality. + """ return NotImplemented if not isinstance(other,Table) else \ self.shapes == other.shapes and self.data.equals(other.data)