Skip to content

Commit 6d479a6

Browse files
authored
Update tests for new tile values from Stamen (#189)
1 parent 5b560f9 commit 6d479a6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tests/test_ctx.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ def test_validate_zoom():
209209

210210

211211
def test_place():
212-
expected_bbox = [-105.3014509, 39.9643513, -105.1780988, 40.094409]
212+
expected_bbox = [-105.430545, 39.8549856, -105.110545, 40.1749856]
213213
expected_bbox_map = [
214214
-11740727.544603072,
215-
-11701591.786121061,
216-
4852834.0517692715,
217-
4891969.810251278,
215+
-11662456.027639052,
216+
4774562.53480525,
217+
4931105.568733288,
218218
]
219-
expected_zoom = 10
219+
expected_zoom = 9
220220
loc = ctx.Place(SEARCH, zoom_adjust=ADJUST)
221-
assert loc.im.shape == (256, 256, 4)
221+
assert loc.im.shape == (512, 256, 4)
222222
loc # Make sure repr works
223223

224224
# Check auto picks are correct
@@ -298,11 +298,11 @@ def test_add_basemap():
298298
ctx.add_basemap(ax, source="./test2.tif", reset_extent=True)
299299

300300
assert_array_almost_equal(subset, ax.images[0].get_extent())
301-
assert ax.images[0].get_array().sum() == 12489346
302-
assert ax.images[0].get_array()[:,:,:3].sum() == 8440966
303-
assert ax.images[0].get_array().shape == (126, 126, 4)
304-
assert_array_almost_equal(ax.images[0].get_array()[:,:,:3].mean(), 177.22696733014195)
305-
assert_array_almost_equal(ax.images[0].get_array().mean(), 196.670225)
301+
assert ax.images[0].get_array().sum() == 3187219
302+
assert ax.images[0].get_array()[:,:,:3].sum() == 2175124
303+
assert ax.images[0].get_array().shape == (64, 64, 4)
304+
assert_array_almost_equal(ax.images[0].get_array()[:,:,:3].mean(), 177.01204427083334)
305+
assert_array_almost_equal(ax.images[0].get_array().mean(), 194.53240966796875)
306306
## Full read
307307
f, ax = matplotlib.pyplot.subplots(1)
308308
ax.set_xlim(x1, x2)
@@ -311,17 +311,17 @@ def test_add_basemap():
311311
ctx.add_basemap(ax, source="./test2.tif", reset_extent=False)
312312

313313
raster_extent = (
314-
-11740803.981631357,
315-
-11701668.223149346,
316-
4852910.488797557,
317-
4892046.247279563,
314+
-11740880.418659642,
315+
-11662608.901695622,
316+
4774715.408861821,
317+
4931258.442789858,
318318
)
319319
assert_array_almost_equal(raster_extent, ax.images[0].get_extent())
320-
assert ax.images[0].get_array()[:,:,:3].sum() == 34840247
321-
assert ax.images[0].get_array().sum() == 51551927
322-
assert ax.images[0].get_array().shape == (256, 256, 4)
323-
assert_array_almost_equal(ax.images[0].get_array()[:,:,:3].mean(), 177.20665995279947)
324-
assert_array_almost_equal(ax.images[0].get_array().mean(), 196.654995)
320+
assert ax.images[0].get_array()[:,:,:3].sum() == 76248416
321+
assert ax.images[0].get_array().sum() == 109671776
322+
assert ax.images[0].get_array().shape == (512, 256, 4)
323+
assert_array_almost_equal(ax.images[0].get_array()[:,:,:3].mean(), 193.90974934895834)
324+
assert_array_almost_equal(ax.images[0].get_array().mean(), 209.18231201171875)
325325

326326
# Test with auto-zoom
327327
f, ax = matplotlib.pyplot.subplots(1)

0 commit comments

Comments
 (0)