@@ -97,6 +97,19 @@ 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+ return False
112+
100113 def calc_mdr (self , inten : Union [float , np .ndarray ]) -> np .ndarray :
101114 """Interpolate impact function to a given intensity.
102115
@@ -177,7 +190,7 @@ def from_step_impf(
177190 mdd : tuple [float , float ] = (0 , 1 ),
178191 paa : tuple [float , float ] = (1 , 1 ),
179192 impf_id : int = 1 ,
180- ** kwargs
193+ ** kwargs ,
181194 ):
182195 """Step function type impact function.
183196
@@ -218,7 +231,7 @@ def from_step_impf(
218231 intensity = intensity ,
219232 mdd = mdd ,
220233 paa = paa ,
221- ** kwargs
234+ ** kwargs ,
222235 )
223236
224237 def set_step_impf (self , * args , ** kwargs ):
@@ -238,7 +251,7 @@ def from_sigmoid_impf(
238251 x0 : float ,
239252 haz_type : str ,
240253 impf_id : int = 1 ,
241- ** kwargs
254+ ** kwargs ,
242255 ):
243256 r"""Sigmoid type impact function hinging on three parameter.
244257
@@ -287,7 +300,7 @@ def from_sigmoid_impf(
287300 intensity = intensity ,
288301 paa = paa ,
289302 mdd = mdd ,
290- ** kwargs
303+ ** kwargs ,
291304 )
292305
293306 def set_sigmoid_impf (self , * args , ** kwargs ):
@@ -308,7 +321,7 @@ def from_poly_s_shape(
308321 exponent : float ,
309322 haz_type : str ,
310323 impf_id : int = 1 ,
311- ** kwargs
324+ ** kwargs ,
312325 ):
313326 r"""S-shape polynomial impact function hinging on four parameter.
314327
0 commit comments