@@ -149,6 +149,40 @@ def test_less_than_n_by_3_points_should_work(self):
149149 assert_almost_equal (lonsout_expected , lonsout )
150150
151151
152+ class TestProjectCoords (TestCase ):
153+ def get_data (self ):
154+ lons , lats = np .arange (- 180 , 180 , 20 ), np .arange (- 90 , 90 , 10 )
155+ lats , lons = np .meshgrid (lats , lons )
156+ lons , lats = lons .copy (order = "F" ), lats .copy (order = "F" )
157+ return lons , lats , Basemap (projection = "sinu" , lon_0 = 0 )
158+
159+
160+ def test_convert (self ):
161+ """
162+ Should not fail on C non-contiguous arrays
163+ """
164+ lons , lats , bmp = self .get_data ()
165+ assert not lons .flags ['C_CONTIGUOUS' ]
166+ assert isinstance (lons , np .ndarray )
167+ assert isinstance (bmp , Basemap )
168+
169+ xx1 , yy1 = bmp (lons , lats )
170+
171+
172+ def test_results_should_be_same_for_c_and_f_order_arrays (self ):
173+
174+ lons , lats , bmp = self .get_data ()
175+
176+ xx1 , yy1 = bmp (lons .copy (order = "C" ), lats .copy (order = "C" ))
177+ xx2 , yy2 = bmp (lons .copy (order = "F" ), lats .copy (order = "F" ))
178+
179+ assert_almost_equal (xx1 , xx2 )
180+ assert_almost_equal (yy1 , yy2 )
181+
182+
183+
184+
185+
152186def test ():
153187 """
154188 Run some tests.
0 commit comments