Skip to content

Commit c082d80

Browse files
857 update contextily errors with 130 (#858)
* added contextily testcase * updated pyproject.toml
1 parent fb2c4fc commit c082d80

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ dependencies = [
2626
"geopandas>=0.13.0",
2727
#fiona<1.9 does not contain sql where filter
2828
"fiona>=1.9",
29-
#contextily<1.0.0 is from April 2020
30-
"contextily>=1.0.0",
29+
#contextily<1.4.0 raises AttributeError and UnidentifiedImageError: https://github.com/Deltares/dfm_tools/issues/857
30+
"contextily>=1.4.0",
3131
#xarray<2023.9.0 does not support multidimensional coordinates (used in e.g. HIRLAM meteo data)
3232
"xarray>=2023.9.0",
3333
#dask version is aligned with xarray

tests/test_external_packages.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import numpy as np
1313
import matplotlib.pyplot as plt
1414
import dfm_tools as dfmt
15+
import contextily as ctx
1516

1617

1718
@pytest.mark.unittest
@@ -165,3 +166,16 @@ def test_xarray_decode_default_fillvals(tmp_path):
165166
fnc_new = uds2.grid.face_node_connectivity
166167

167168
assert fill_value_default in fnc_new
169+
170+
171+
@pytest.mark.unittest
172+
def test_ctx_add_basemap():
173+
"""
174+
tests wheter this often used function still works, it fails in contextily 1.3.0
175+
mainly relevant to update the minimal contextily version in the pyproject.toml file sometimes
176+
https://github.com/Deltares/dfm_tools/issues/857
177+
"""
178+
_, ax = plt.subplots()
179+
ax.set_xlim(1.8,3.2)
180+
ax.set_ylim(50.8, 52.2)
181+
ctx.add_basemap(ax=ax,crs="EPSG:4326",attribution=False)

0 commit comments

Comments
 (0)