@@ -57,52 +57,52 @@ class TestShiftGrid(TestCase):
57
57
58
58
def make_data_cyc (self ):
59
59
loncyc = np .array ([0 , 30 , 60 , 90 , 120 , 150 , 180 , 210 , 240 , 270 , 300 ,\
60
- 330 , 360 ], dtype = np .int )
60
+ 330 , 360 ],dtype = np .float )
61
61
gridcyc = np .array ([[0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ,\
62
- 11 , 0 ]], dtype = np .int )
62
+ 11 , 0 ]],dtype = np .float )
63
63
lonoutcyc = np .array ([- 180 , - 150 , - 120 , - 90 , - 60 , - 30 , 0 , 30 ,60 ,90 ,\
64
- 120 , 150 , 180 ], dtype = np .int )
64
+ 120 , 150 , 180 ],dtype = np .float )
65
65
gridoutcyc = np .array ([[ 6 , 7 , 8 , 9 , 10 , 11 , 0 , 1 , 2 ,3 ,\
66
- 4 , 5 , 6 ]], dtype = np .int )
66
+ 4 , 5 , 6 ]],dtype = np .float )
67
67
return loncyc , gridcyc , lonoutcyc , gridoutcyc
68
68
69
69
def make_data_nocyc (self ):
70
70
lonnocyc = np .array ([0 , 30 , 60 , 90 , 120 , 150 , 180 , 210 , 240 , 270 ,\
71
- 300 , 330 ], dtype = np .int )
71
+ 300 , 330 ],dtype = np .float )
72
72
gridnocyc = np .array ([[0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ,\
73
- 10 , 11 ]], dtype = np .int )
73
+ 10 , 11 ]],dtype = np .float )
74
74
lonoutnocyc = np .array ([- 180 , - 150 , - 120 , - 90 , - 60 , - 30 , 0 , 30 , 60 ,\
75
- 90 , 120 , 150 ], dtype = np .int )
75
+ 90 , 120 , 150 ],dtype = np .float )
76
76
gridoutnocyc = np .array ([[ 6 , 7 , 8 , 9 , 10 , 11 , 0 , 1 , 2 ,\
77
- 3 , 4 , 5 ]], dtype = np .int )
77
+ 3 , 4 , 5 ]],dtype = np .float )
78
78
return lonnocyc , gridnocyc , lonoutnocyc , gridoutnocyc
79
79
80
80
def make_data_nocyc2 (self ):
81
81
lonnocyc2 = np .array ([15 , 45 , 75 , 105 , 135 , 165 , 195 , 225 , 255 , 285 ,\
82
- 315 , 345 ], dtype = np .int )
82
+ 315 , 345 ],dtype = np .float )
83
83
gridnocyc2 = np .array ([[0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ,\
84
- 10 , 11 ]], dtype = np .int )
84
+ 10 , 11 ]],dtype = np .float )
85
85
lonoutnocyc2 = np .array ([- 165 , - 135 , - 105 , - 75 , - 45 , - 15 , 15 ,45 ,75 ,\
86
- 105 , 135 , 165 ], dtype = np .int )
86
+ 105 , 135 , 165 ],dtype = np .float )
87
87
gridoutnocyc2 = np .array ([[ 6 , 7 , 8 , 9 , 10 , 11 , 0 , 1 , 2 ,\
88
- 3 , 4 , 5 ]], dtype = np .int )
88
+ 3 , 4 , 5 ]],dtype = np .float )
89
89
return lonnocyc2 , gridnocyc2 , lonoutnocyc2 , gridoutnocyc2
90
90
91
91
def test_cyc (self ):
92
92
lonin , gridin , lonout , gridout = self .make_data_cyc ()
93
- grid , lon = shiftgrid (lonin [len (lonin )/ 2 ], gridin , lonin , start = False )
93
+ grid , lon = shiftgrid (lonin [len (lonin )// 2 ], gridin , lonin , start = False )
94
94
assert (lon == lonout ).all ()
95
95
assert (grid == gridout ).all ()
96
96
97
97
def test_no_cyc (self ):
98
98
lonin , gridin , lonout , gridout = self .make_data_nocyc ()
99
- grid , lon = shiftgrid (lonin [len (lonin )/ 2 ], gridin , lonin , start = False )
99
+ grid , lon = shiftgrid (lonin [len (lonin )// 2 ], gridin , lonin , start = False )
100
100
assert (lon == lonout ).all ()
101
101
assert (grid == gridout ).all ()
102
102
103
103
def test_no_cyc2 (self ):
104
104
lonin , gridin , lonout , gridout = self .make_data_nocyc2 ()
105
- grid , lon = shiftgrid (lonin [len (lonin )/ 2 ], gridin , lonin , start = False )
105
+ grid , lon = shiftgrid (lonin [len (lonin )// 2 ], gridin , lonin , start = False )
106
106
assert (lon == lonout ).all ()
107
107
assert (grid == gridout ).all ()
108
108
@@ -221,4 +221,3 @@ def test():
221
221
print ('{0}\n ' .format (pkg_vers ))
222
222
223
223
unittest .main ()
224
-
0 commit comments