Skip to content

Commit 5afc170

Browse files
committed
add a test to make sure that shiftdata still works as expected for a simple case
1 parent 70630ed commit 5afc170

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/mpl_toolkits/basemap/test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@ def test_non_monotonous_longitudes(self):
137137
assert lon <= bm.projparams["lon_0"] + 180
138138

139139

140+
def test_shiftdata_on_monotonous_lons(self):
141+
"""
142+
Test that shiftdata with fix_wrap_around keyword added works as before,
143+
when it is True
144+
"""
145+
146+
bm = Basemap(lon_0=0)
147+
148+
lons_in = [120, 140, 160, 180, 200, 220]
149+
lons_out_expect = [-160, -140, 120, 140, 160, 180]
150+
lons_out = bm.shiftdata(lons_in, fix_wrap_around=True)
151+
152+
assert_almost_equal(lons_out, lons_out_expect)
153+
154+
140155

141156
def test_2_points_should_work(self):
142157
"""

0 commit comments

Comments
 (0)