Skip to content

Commit

Permalink
handle type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Sep 23, 2024
1 parent 057ed5d commit b04cd5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stcal/jump/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def __mul__(self, factor: float) -> 'Circle':
def __contains__(self, point: tuple[float, float]) -> bool:
return numpy.hypot(*(numpy.array(point) - self.center)) <= self.radius * RELATIVE_TOLERANCE

def __eq__(self, other: 'Circle') -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, Circle):
return False
return numpy.all(self.center == other.center) and self.radius == other.radius

def almost_equals(self, other: 'Circle', delta: Optional[float] = None) -> bool:
Expand Down

0 comments on commit b04cd5b

Please sign in to comment.