Skip to content

Commit

Permalink
MNT: Add depreciation warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman committed Oct 12, 2023
1 parent ae58d37 commit 7c7f309
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 13 additions & 3 deletions act/plotting/geodisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""

import warnings

import matplotlib
import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -59,6 +61,7 @@ def geoplot(
img_tile=None,
img_tile_args={},
tile=8,
stamen='terrain-background',
cartopy_feature=None,
cmap='rainbow',
text=None,
Expand Down Expand Up @@ -207,9 +210,16 @@ def geoplot(
else:
plt.title(title)

if img_tile is not None:
tiler = getattr(img_tiles, img_tile)(**img_tile_args)
ax.add_image(tiler, tile)
if stamen and img_tile is None:
tiler = img_tiles.Stamen(stamen)
warnings.warn(
"Stamen is deprecated in Cartopy and in future versions of ACT, "
"please use img_tile to specify the image background. ")
else:
if img_tile is not None:
tiler = getattr(img_tiles, img_tile)(**img_tile_args)

ax.add_image(tiler, tile)

colorbar_map = None
if cmap is not None:
Expand Down
1 change: 1 addition & 0 deletions act/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def test_geoplot():
],
text={'Ponca City': [-97.0725, 36.7125]},
img_tile=None,
stamen=None,
)
try:
return geodisplay.fig
Expand Down

0 comments on commit 7c7f309

Please sign in to comment.