@@ -36,28 +36,29 @@ def test_calc_mdr_pass(self):
3636 new_inten = 17.2
3737 self .assertEqual (imp_fun .calc_mdr (new_inten ), 0.029583999999999996 )
3838
39- def test_set_step (self ):
39+ def test_from_step (self ):
4040 """Check default impact function: step function"""
4141 inten = (0 , 5 , 10 )
4242 imp_fun = ImpactFunc .from_step_impf (
43- intensity = inten , haz_type = 'TC' , intensity_unit = 'm/s' )
43+ intensity = inten , haz_type = 'TC' , impf_id = 2 )
4444 self .assertTrue (np .array_equal (imp_fun .paa , np .ones (4 )))
4545 self .assertTrue (np .array_equal (imp_fun .mdd , np .array ([0 , 0 , 1 , 1 ])))
4646 self .assertTrue (np .array_equal (imp_fun .intensity , np .array ([0 , 5 , 5 , 10 ])))
4747 self .assertEqual (imp_fun .haz_type , 'TC' )
48- self .assertEqual (imp_fun .intensity_unit , 'm/s' )
48+ self .assertEqual (imp_fun .id , 2 )
4949
50- def test_set_sigmoid (self ):
50+
51+ def test_from_sigmoid (self ):
5152 """Check default impact function: sigmoid function"""
5253 inten = (0 , 100 , 5 )
5354 imp_fun = ImpactFunc .from_sigmoid_impf (
54- inten , L = 1.0 , k = 2. , x0 = 50. , haz_type = 'RF' , name = 'sigmoid impf' )
55+ inten , L = 1.0 , k = 2. , x0 = 50. , haz_type = 'RF' , impf_id = 2 )
5556 self .assertTrue (np .array_equal (imp_fun .paa , np .ones (20 )))
5657 self .assertEqual (imp_fun .mdd [10 ], 0.5 )
5758 self .assertEqual (imp_fun .mdd [- 1 ], 1.0 )
5859 self .assertTrue (np .array_equal (imp_fun .intensity , np .arange (0 , 100 , 5 )))
5960 self .assertEqual (imp_fun .haz_type , 'RF' )
60- self .assertEqual (imp_fun .name , 'sigmoid impf' )
61+ self .assertEqual (imp_fun .id , 2 )
6162
6263# Execute Tests
6364if __name__ == "__main__" :
0 commit comments