Skip to content

Commit

Permalink
Implement __eq__ for _SymmetricGradientExtrapolation
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 14, 2024
1 parent 2f9dbf4 commit bcca6bd
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion phiml/math/extrapolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def sparse_pad_values(self, value: Tensor, connectivity: Tensor, dim: str, **kwa
raise NotImplementedError


class _SymmetricGradientExtrapolation(Extrapolation): # ToDo this class is missing a lot of methods
class _SymmetricGradientExtrapolation(Extrapolation):

def __init__(self):
super().__init__(pad_rank=3)
Expand Down Expand Up @@ -930,6 +930,45 @@ def pad_values(self, value: Tensor, width: int, dim: str, upper_edge: bool, alre
def sparse_pad_values(self, value: Tensor, connectivity: Tensor, dim: str, **kwargs) -> Tensor:
raise NotImplementedError

def determines_boundary_values(self, boundary_key: Union[Tuple[str, bool], str]) -> bool:
raise NotImplementedError

def __eq__(self, other):
return isinstance(other, _SymmetricGradientExtrapolation)

def __hash__(self):
return 209385671

def __abs__(self):
raise NotImplementedError

def __neg__(self):
raise NotImplementedError

def __add__(self, other):
raise NotImplementedError

def __radd__(self, other):
raise NotImplementedError

def __sub__(self, other):
raise NotImplementedError

def __rsub__(self, other):
raise NotImplementedError

def __mul__(self, other):
raise NotImplementedError

def __rmul__(self, other):
raise NotImplementedError

def __truediv__(self, other):
raise NotImplementedError

def __rtruediv__(self, other):
raise NotImplementedError


class _NoExtrapolation(Extrapolation): # singleton

Expand Down

0 comments on commit bcca6bd

Please sign in to comment.