diff --git a/aerosandbox/geometry/airfoil/airfoil.py b/aerosandbox/geometry/airfoil/airfoil.py index dbcef6d4..155c0be3 100644 --- a/aerosandbox/geometry/airfoil/airfoil.py +++ b/aerosandbox/geometry/airfoil/airfoil.py @@ -208,11 +208,19 @@ def __eq__(self, other: "Airfoil") -> bool: return False # At this point, we know that the types are the same, so we can compare the attributes - return all([ # If all of these are true, they're equal - self.name == other.name, - np.allclose(self.coordinates, other.coordinates) if - self.coordinates.shape == other.coordinates.shape else False, - ]) + if self.name != other.name: # If the names are different, they're not equal + return False + + if self.coordinates.shape != other.coordinates.shape: # If the coordinates are different shapes, they're not equal + return False + + try: + return np.allclose( + self.coordinates, + other.coordinates + ) + except Exception: + return False def to_kulfan_airfoil(self, n_weights_per_side: int = 8,