From 49b28d57f35ab362085ce114c3b92f6d6a465ddb Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 29 Aug 2024 14:17:36 -0400 Subject: [PATCH] handle type checks --- src/stcal/jump/circle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stcal/jump/circle.py b/src/stcal/jump/circle.py index 2775fdca3..09d46cb8b 100644 --- a/src/stcal/jump/circle.py +++ b/src/stcal/jump/circle.py @@ -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: