Skip to content

Commit fcc8798

Browse files
committed
C-order and F-order arrays should give the same projected coordinates
1 parent 7db6708 commit fcc8798

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/mpl_toolkits/basemap/test.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,24 @@ def test_convert(self):
110110
"""
111111
lons, lats, bmp = self.get_data()
112112
assert not lons.flags['C_CONTIGUOUS']
113-
114113
assert isinstance(lons, np.ndarray)
115-
116114
assert isinstance(bmp, Basemap)
117115

118116
xx1, yy1 = bmp(lons, lats)
119117

120118

119+
def test_results_should_be_same_for_c_and_f_order_arrays(self):
120+
121+
lons, lats, bmp = self.get_data()
122+
123+
xx1, yy1 = bmp(lons.copy(order="C"), lats.copy(order="C"))
124+
xx2, yy2 = bmp(lons.copy(order="F"), lats.copy(order="F"))
125+
126+
assert_almost_equal(xx1, xx2)
127+
assert_almost_equal(yy1, yy2)
128+
129+
130+
121131

122132

123133

0 commit comments

Comments
 (0)