Skip to content

Commit fcb7a4c

Browse files
committed
Copy arrays using slicing, should work for Python2 and 3
1 parent efc87b6 commit fcb7a4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mpl_toolkits/basemap/test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_2_points_should_work(self):
112112
bm = Basemap(llcrnrlon=0, llcrnrlat=-80, urcrnrlon=360, urcrnrlat=80, projection='mill')
113113

114114
lons_expected = [10, 15, 20]
115-
lonsout = bm.shiftdata(lons_expected.copy())
115+
lonsout = bm.shiftdata(lons_expected[:])
116116
assert_almost_equal(lons_expected, lonsout)
117117

118118
lonsout_expected = bm.shiftdata([10, 361, 362])
@@ -131,7 +131,7 @@ def test_1_point_should_work(self):
131131

132132
lonsin = np.array([361.0])
133133
lonsin.shape = (1, 1)
134-
lonsout = bm.shiftdata(lonsin.copy())
134+
lonsout = bm.shiftdata(lonsin[:])
135135
assert_almost_equal(lonsout.squeeze(), [1.0,])
136136

137137
def test_less_than_n_by_3_points_should_work(self):
@@ -144,7 +144,7 @@ def test_less_than_n_by_3_points_should_work(self):
144144

145145
# shift n x 3 and n x 2 grids and compare results over overlapping region
146146
lonsin = self._get_2d_lons([10, 361, 362])
147-
lonsout_expected = bm.shiftdata(lonsin.copy())[:, :2]
147+
lonsout_expected = bm.shiftdata(lonsin[:])[:, :2]
148148
lonsout = bm.shiftdata(lonsin[:, :2])
149149
assert_almost_equal(lonsout_expected, lonsout)
150150

0 commit comments

Comments
 (0)