@@ -97,6 +97,20 @@ def __init__(
9797 self .mdd = mdd if mdd is not None else np .array ([])
9898 self .paa = paa if paa is not None else np .array ([])
9999
100+ def __eq__ (self , value : object , / ) -> bool :
101+ if isinstance (value , ImpactFunc ):
102+ return (
103+ self .haz_type == value .haz_type
104+ and self .id == value .id
105+ and self .name == value .name
106+ and self .intensity_unit == value .intensity_unit
107+ and np .array_equal (self .intensity , value .intensity )
108+ and np .array_equal (self .mdd , value .mdd )
109+ and np .array_equal (self .paa , value .paa )
110+ )
111+ else :
112+ return False
113+
100114 def calc_mdr (self , inten : Union [float , np .ndarray ]) -> np .ndarray :
101115 """Interpolate impact function to a given intensity.
102116
@@ -177,7 +191,7 @@ def from_step_impf(
177191 mdd : tuple [float , float ] = (0 , 1 ),
178192 paa : tuple [float , float ] = (1 , 1 ),
179193 impf_id : int = 1 ,
180- ** kwargs
194+ ** kwargs ,
181195 ):
182196 """Step function type impact function.
183197
@@ -218,7 +232,7 @@ def from_step_impf(
218232 intensity = intensity ,
219233 mdd = mdd ,
220234 paa = paa ,
221- ** kwargs
235+ ** kwargs ,
222236 )
223237
224238 def set_step_impf (self , * args , ** kwargs ):
@@ -238,7 +252,7 @@ def from_sigmoid_impf(
238252 x0 : float ,
239253 haz_type : str ,
240254 impf_id : int = 1 ,
241- ** kwargs
255+ ** kwargs ,
242256 ):
243257 r"""Sigmoid type impact function hinging on three parameter.
244258
@@ -287,7 +301,7 @@ def from_sigmoid_impf(
287301 intensity = intensity ,
288302 paa = paa ,
289303 mdd = mdd ,
290- ** kwargs
304+ ** kwargs ,
291305 )
292306
293307 def set_sigmoid_impf (self , * args , ** kwargs ):
@@ -308,7 +322,7 @@ def from_poly_s_shape(
308322 exponent : float ,
309323 haz_type : str ,
310324 impf_id : int = 1 ,
311- ** kwargs
325+ ** kwargs ,
312326 ):
313327 r"""S-shape polynomial impact function hinging on four parameter.
314328
0 commit comments