Skip to content

Commit 939d079

Browse files
committed
rename class
1 parent fb71e95 commit 939d079

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

climada/entity/impact_funcs/tc_emanuel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Define impact function for tropical cyclnes using the formula of Emanuele 2011.
33
"""
44

5-
__all__ = ['IFEmanuele']
5+
__all__ = ['IFEmanuelUSA']
66

77
import logging
88
import numpy as np
@@ -11,7 +11,7 @@
1111

1212
LOGGER = logging.getLogger(__name__)
1313

14-
class IFEmanuele(ImpactFunc):
14+
class IFEmanuelUSA(ImpactFunc):
1515
"""Impact function for tropical cyclones according to Emanuele 2011."""
1616

1717
def __init__(self, if_id=1, intensity=np.arange(0, 121, 5), v_thresh=25.7,

climada/entity/impact_funcs/test/test_tc_emanuel.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"""
2-
Test IFEmanuele class.
2+
Test IFEmanuelUSA class.
33
"""
44

55
import unittest
66
import 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

1010
class 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
105105
TESTS = unittest.TestLoader().loadTestsFromTestCase(TestEmanuelFormula)

0 commit comments

Comments
 (0)