11"""
2- Test IFEmanuele class.
2+ Test IFEmanuelUSA class.
33"""
44
55import unittest
66import numpy as np
77
8- from climada .entity .impact_funcs .tc_emanuel import IFEmanuele
8+ from climada .entity .impact_funcs .tc_emanuel import IFEmanuelUSA
99
1010class TestEmanuelFormula (unittest .TestCase ):
1111 """Impact function interpolation test"""
1212
1313 def test_default_values_pass (self ):
1414 """Compute mdr interpolating values."""
15- imp_fun = IFEmanuele ()
15+ imp_fun = IFEmanuelUSA ()
1616 self .assertEqual (imp_fun .name , 'Emanuel 2011' )
1717 self .assertEqual (imp_fun .haz_type , 'TC' )
1818 self .assertEqual (imp_fun .id , 1 )
@@ -31,7 +31,7 @@ def test_default_values_pass(self):
3131
3232 def test_values_pass (self ):
3333 """Compute mdr interpolating values."""
34- imp_fun = IFEmanuele (if_id = 5 , intensity = np .arange (0 ,6 ,1 ), v_thresh = 2 ,
34+ imp_fun = IFEmanuelUSA (if_id = 5 , intensity = np .arange (0 ,6 ,1 ), v_thresh = 2 ,
3535 v_half = 5 , scale = 0.5 )
3636 self .assertEqual (imp_fun .name , 'Emanuel 2011' )
3737 self .assertEqual (imp_fun .haz_type , 'TC' )
@@ -45,7 +45,7 @@ def test_values_pass(self):
4545
4646 def test_set_scale (self ):
4747 """Set scale parameter."""
48- imp_fun = IFEmanuele ()
48+ imp_fun = IFEmanuelUSA ()
4949 scale = 0.5
5050 imp_fun .set_scale (scale )
5151 self .assertEqual (imp_fun .name , 'Emanuel 2011' )
@@ -66,7 +66,7 @@ def test_set_scale(self):
6666
6767 def test_set_shape (self ):
6868 """Set shape parameters."""
69- imp_fun = IFEmanuele (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
69+ imp_fun = IFEmanuelUSA (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
7070 v_thresh = 2
7171 v_half = 5
7272 imp_fun .set_shape (v_thresh , v_half )
@@ -82,24 +82,24 @@ def test_set_shape(self):
8282
8383 def test_wrong_shape (self ):
8484 """Set shape parameters."""
85- imp_fun = IFEmanuele (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
85+ imp_fun = IFEmanuelUSA (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
8686 v_thresh = 2
8787 v_half = 1
8888 with self .assertRaises (ValueError ):
8989 imp_fun .set_shape (v_thresh , v_half )
9090
9191 with self .assertRaises (ValueError ):
92- IFEmanuele (v_thresh = v_thresh , v_half = v_half )
92+ IFEmanuelUSA (v_thresh = v_thresh , v_half = v_half )
9393
9494 def test_wrong_scale (self ):
9595 """Set shape parameters."""
96- imp_fun = IFEmanuele (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
96+ imp_fun = IFEmanuelUSA (if_id = 5 , intensity = np .arange (0 ,6 ,1 ))
9797 scale = 2
9898 with self .assertRaises (ValueError ):
9999 imp_fun .set_scale (scale )
100100
101101 with self .assertRaises (ValueError ):
102- IFEmanuele (scale = scale )
102+ IFEmanuelUSA (scale = scale )
103103
104104# Execute Tests
105105TESTS = unittest .TestLoader ().loadTestsFromTestCase (TestEmanuelFormula )
0 commit comments