@@ -35,6 +35,23 @@ def test_calc_mdr_pass(self):
3535 imp_fun .mdd = np .arange (0 , 1 , 0.1 )
3636 new_inten = 17.2
3737 self .assertEqual (imp_fun .calc_mdr (new_inten ), 0.029583999999999996 )
38+
39+ def test_set_step (self ):
40+ """Check default impact function: step function"""
41+ imp_fun = ImpactFunc ()
42+ imp_fun .set_step_ImpF (5 , 0 , 10 )
43+ self .assertTrue (np .array_equal (imp_fun .paa , np .ones (4 )))
44+ self .assertTrue (np .array_equal (imp_fun .mdd , np .array ([0 , 0 , 1 , 1 ])))
45+ self .assertTrue (np .array_equal (imp_fun .intensity , np .array ([0 , 5 , 5 , 10 ])))
46+
47+ def test_set_sigmoid (self ):
48+ """Check default impact function: sigmoid function"""
49+ imp_fun = ImpactFunc ()
50+ imp_fun .set_sigmoid_ImpF (50. , 2. , 1.0 , 0 , 100 )
51+ self .assertTrue (np .array_equal (imp_fun .paa , np .ones (20 )))
52+ self .assertEqual (imp_fun .mdd [10 ], 0.5 )
53+ self .assertEqual (imp_fun .mdd [- 1 ], 1.0 )
54+ self .assertTrue (np .array_equal (imp_fun .intensity , np .arange (0 , 100 , 5 )))
3855
3956# Execute Tests
4057if __name__ == "__main__" :
0 commit comments