Repository navigation
Closed
Description
Suddenly the docs break with following errors:
Unexpected failing examples:
/home/runner/work/pygmt/pygmt/examples/gallery/maps/tilemaps.py failed leaving traceback:
Traceback (most recent call last):
File "/home/runner/work/pygmt/pygmt/examples/gallery/maps/tilemaps.py", line 37, in <module>
fig.tilemap(
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/pygmt/helpers/decorators.py", line 598, in new_module
return module_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/pygmt/helpers/decorators.py", line 738, in new_module
return module_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/pygmt/src/tilemap.py", line 125, in tilemap
raster = load_tile_map(
^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/pygmt/datasets/tile_map.py", line 120, in load_tile_map
image, extent = contextily.bounds2img(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/contextily/tile.py", line 225, in bounds2img
merged, extent = _merge_tiles(tiles, arrays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/pygmt/lib/python3.11/site-packages/contextily/tile.py", line 628, in _merge_tiles
img[y * h : (y + 1) * h, x * w : (x + 1) * w, :] = arr
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not broadcast input array from shape (512,512,4) into shape (256,256,4)
Activity
weiji14 commentedon Oct 4, 2023
Yes, see geopandas/contextily#223, which is part of the Stamen Maps migration, xref #2699. We should change away from using any Stamen basemaps soon.
yvonnefroehlich commentedon Oct 4, 2023
The problem is related to the second code example of the Gallery example tilemaps.
When removing the second code example, the documentation is built successfully.
For the second example, it actually depends on the zoom factor whether the documentation is built successfully.
zoom=13andzoom=15work for me locally, butzoom=14leads to the error reported above and in the issue mentioned by @weiji14:I just tried
zoom=13in commit aa7180e and the documentation was build successfully. Edit: And it also works withzoom=15, see commit 03f1599 and https://pygmt-dev--2706.org.readthedocs.build/en/2706/gallery/maps/tilemaps.html.weiji14 commentedon Oct 4, 2023
Hmm, maybe it's related to some rounding issue. I've started a PR to completely switch away from Stamen at #2717.