Skip to content

Commit f37803f

Browse files
committed
fix for DeprecationWarning: using a non-integer
Fixes these deprecation warnings from unitest in the TestShiftGrid class: > test_cyc (__main__.TestShiftGrid) ... lib/mpl_toolkits/basemap/test.py:93: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future This was done by changing the numpy arrays datatype from float to int.
1 parent 5dcac8c commit f37803f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/mpl_toolkits/basemap/test.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,35 +57,35 @@ class TestShiftGrid(TestCase):
5757

5858
def make_data_cyc(self):
5959
loncyc = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300,\
60-
330, 360],dtype=np.float)
60+
330, 360], dtype=np.int)
6161
gridcyc = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,\
62-
11, 0]],dtype=np.float)
62+
11, 0]], dtype=np.int)
6363
lonoutcyc = np.array([-180, -150, -120, -90, -60, -30, 0, 30,60,90,\
64-
120, 150, 180],dtype=np.float)
64+
120, 150, 180], dtype=np.int)
6565
gridoutcyc = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,3,\
66-
4, 5, 6]],dtype=np.float)
66+
4, 5, 6]], dtype=np.int)
6767
return loncyc, gridcyc, lonoutcyc, gridoutcyc
6868

6969
def make_data_nocyc(self):
7070
lonnocyc = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270,\
71-
300, 330],dtype=np.float)
71+
300, 330], dtype=np.int)
7272
gridnocyc = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\
73-
10, 11]],dtype=np.float)
73+
10, 11]], dtype=np.int)
7474
lonoutnocyc = np.array([-180, -150, -120, -90, -60, -30, 0, 30, 60,\
75-
90, 120, 150],dtype=np.float)
75+
90, 120, 150], dtype=np.int)
7676
gridoutnocyc = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,\
77-
3, 4, 5]],dtype=np.float)
77+
3, 4, 5]], dtype=np.int)
7878
return lonnocyc, gridnocyc, lonoutnocyc, gridoutnocyc
7979

8080
def make_data_nocyc2(self):
8181
lonnocyc2 = np.array([15, 45, 75, 105, 135, 165, 195, 225, 255, 285,\
82-
315, 345],dtype=np.float)
82+
315, 345], dtype=np.int)
8383
gridnocyc2 = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\
84-
10, 11]],dtype=np.float)
84+
10, 11]], dtype=np.int)
8585
lonoutnocyc2 = np.array([-165, -135, -105, -75, -45, -15, 15,45,75,\
86-
105, 135, 165],dtype=np.float)
86+
105, 135, 165], dtype=np.int)
8787
gridoutnocyc2 = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,\
88-
3, 4, 5]],dtype=np.float)
88+
3, 4, 5]], dtype=np.int)
8989
return lonnocyc2, gridnocyc2, lonoutnocyc2, gridoutnocyc2
9090

9191
def test_cyc(self):

0 commit comments

Comments
 (0)