Skip to content

Commit 49658d7

Browse files
authored
Bump minimum supported version to contextily>=1.5 (#3912)
1 parent 16e6762 commit 49658d7

File tree

5 files changed

+4
-21
lines changed

5 files changed

+4
-21
lines changed

.github/workflows/ci_tests_legacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
xarray
6767
netCDF4
6868
packaging
69-
contextily
69+
contextily=1.5
7070
geopandas=1.0
7171
ipython
7272
pyarrow-core

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- netCDF4
1414
- packaging
1515
# Optional dependencies
16-
- contextily
16+
- contextily>=1.5
1717
- geopandas>=1.0
1818
- ipython
1919
- pyarrow-core

pygmt/datasets/tile_map.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from collections.abc import Sequence
77
from typing import Literal
88

9-
from packaging.version import Version
10-
119
try:
1210
import contextily
1311
from rasterio.crs import CRS
@@ -100,9 +98,6 @@ def load_tile_map(
10098
The amount to adjust a chosen zoom level if it is chosen automatically. Values
10199
outside of -1 to 1 are not recommended as they can lead to slow execution.
102100
103-
.. note::
104-
The ``zoom_adjust`` parameter requires ``contextily>=1.5.0``.
105-
106101
Returns
107102
-------
108103
raster
@@ -165,16 +160,8 @@ def load_tile_map(
165160
"ll": lonlat,
166161
"wait": wait,
167162
"max_retries": max_retries,
163+
"zoom_adjust": zoom_adjust,
168164
}
169-
# TODO(contextily>=1.5.0): Remove the check for the 'zoom_adjust' parameter.
170-
if zoom_adjust is not None:
171-
if Version(contextily.__version__) < Version("1.5.0"):
172-
msg = (
173-
"The `zoom_adjust` parameter requires `contextily>=1.5.0` to work. "
174-
"Please upgrade contextily, or manually set the `zoom` level instead."
175-
)
176-
raise ValueError(msg)
177-
contextily_kwargs["zoom_adjust"] = zoom_adjust
178165

179166
west, east, south, north = region
180167
image, extent = contextily.bounds2img(

pygmt/src/tilemap.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ def tilemap(
102102
zoom_adjust
103103
The amount to adjust a chosen zoom level if it is chosen automatically. Values
104104
outside of -1 to 1 are not recommended as they can lead to slow execution.
105-
106-
.. note::
107-
The ``zoom_adjust`` parameter requires ``contextily>=1.5.0``.
108-
109105
kwargs : dict
110106
Extra keyword arguments to pass to :meth:`pygmt.Figure.grdimage`.
111107
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dynamic = ["version"]
4545

4646
[project.optional-dependencies]
4747
all = [
48-
"contextily",
48+
"contextily>=1.5",
4949
"geopandas>=1.0",
5050
"IPython", # 'ipython' is not the correct module name.
5151
"pyarrow",

0 commit comments

Comments
 (0)