diff --git a/aerosandbox/geometry/airfoil/airfoil.py b/aerosandbox/geometry/airfoil/airfoil.py index 5a0f447c..83a398b5 100644 --- a/aerosandbox/geometry/airfoil/airfoil.py +++ b/aerosandbox/geometry/airfoil/airfoil.py @@ -190,38 +190,6 @@ def default_CM_function(alpha, Re, mach=0, deflection=0): def __repr__(self) -> str: return f"Airfoil {self.name} ({self.n_points()} points)" - def __eq__(self, other: "Airfoil") -> bool: - """ - Checks if two airfoils are equal. Two airfoils are equal if they have the same name, coordinates, and - polar functions. - - Args: - other: The other airfoil to compare to. - - Returns: - True if the two airfoils are equal, False otherwise. - """ - if other is self: # If they're the same object in memory, they're equal - return True - - if not type(self) == type(other): # If the types are different, they're not equal - return False - - # At this point, we know that the types are the same, so we can compare the attributes - 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, N1: float = 0.5, diff --git a/aerosandbox/geometry/airfoil/kulfan_airfoil.py b/aerosandbox/geometry/airfoil/kulfan_airfoil.py index 35d01955..6f4017dd 100644 --- a/aerosandbox/geometry/airfoil/kulfan_airfoil.py +++ b/aerosandbox/geometry/airfoil/kulfan_airfoil.py @@ -66,24 +66,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): def __repr__(self) -> str: return f"Airfoil {self.name} (Kulfan / CST parameterization)" - def __eq__(self, other: "KulfanAirfoil") -> bool: - if other is self: # If they're the same object in memory, they're equal - return True - - if not type(self) == type(other): # If the types are different, they're not equal - return False - - # At this point, we know that the types are the same, so we can compare the attributes - return all([ - self.name == other.name, - np.allclose(self.lower_weights, other.lower_weights), - np.allclose(self.upper_weights, other.upper_weights), - np.allclose(self.leading_edge_weight, other.leading_edge_weight), - np.allclose(self.TE_thickness, other.TE_thickness), - np.allclose(self.N1, other.N1), - np.allclose(self.N2, other.N2), - ]) - @property def kulfan_parameters(self): return {