Skip to content

Bump minimum supported version to contextily>=1.5 #3912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
xarray
netCDF4
packaging
contextily
contextily=1.5
geopandas=1.0
ipython
pyarrow-core
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- netCDF4
- packaging
# Optional dependencies
- contextily
- contextily>=1.5
- geopandas>=1.0
- ipython
- pyarrow-core
Expand Down
15 changes: 1 addition & 14 deletions pygmt/datasets/tile_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from collections.abc import Sequence
from typing import Literal

from packaging.version import Version

try:
import contextily
from rasterio.crs import CRS
Expand Down Expand Up @@ -100,9 +98,6 @@ def load_tile_map(
The amount to adjust a chosen zoom level if it is chosen automatically. Values
outside of -1 to 1 are not recommended as they can lead to slow execution.

.. note::
The ``zoom_adjust`` parameter requires ``contextily>=1.5.0``.

Returns
-------
raster
Expand Down Expand Up @@ -165,16 +160,8 @@ def load_tile_map(
"ll": lonlat,
"wait": wait,
"max_retries": max_retries,
"zoom_adjust": zoom_adjust,
}
# TODO(contextily>=1.5.0): Remove the check for the 'zoom_adjust' parameter.
if zoom_adjust is not None:
if Version(contextily.__version__) < Version("1.5.0"):
msg = (
"The `zoom_adjust` parameter requires `contextily>=1.5.0` to work. "
"Please upgrade contextily, or manually set the `zoom` level instead."
)
raise ValueError(msg)
contextily_kwargs["zoom_adjust"] = zoom_adjust

west, east, south, north = region
image, extent = contextily.bounds2img(
Expand Down
4 changes: 0 additions & 4 deletions pygmt/src/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ def tilemap(
zoom_adjust
The amount to adjust a chosen zoom level if it is chosen automatically. Values
outside of -1 to 1 are not recommended as they can lead to slow execution.

.. note::
The ``zoom_adjust`` parameter requires ``contextily>=1.5.0``.

kwargs : dict
Extra keyword arguments to pass to :meth:`pygmt.Figure.grdimage`.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dynamic = ["version"]

[project.optional-dependencies]
all = [
"contextily",
"contextily>=1.5",
"geopandas>=1.0",
"IPython", # 'ipython' is not the correct module name.
"pyarrow",
Expand Down
Loading