Skip to content

Commit

Permalink
MNT: Update img_tile_args to be dictionary, fixed baseline.
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman committed Oct 10, 2023
1 parent 630c54c commit ae793e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions act/plotting/geodisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def geoplot(
projection=None,
plot_buffer=0.08,
img_tile=None,
img_tile_args=[None],
img_tile_args={},
tile=8,
cartopy_feature=None,
cmap='rainbow',
Expand Down Expand Up @@ -97,11 +97,11 @@ def geoplot(
background image. For all image background types, see:
https://scitools.org.uk/cartopy/docs/v0.16/cartopy/io/img_tiles.html
Default is None.
img_tile_args : list
Arguments for the chosen img_tile. These arguments can be found for
the corresponding img_tile here:
img_tile_args : dict
Keyword arguments for the chosen img_tile. These arguments can be
found for the corresponding img_tile here:
https://scitools.org.uk/cartopy/docs/v0.16/cartopy/io/img_tiles.html
Default is None.
Default is an empty dictionary.
tile : int
Tile zoom to use with background image. Higher number indicates
more resolution. A value of 8 is typical for a normal sonde plot.
Expand Down Expand Up @@ -208,7 +208,7 @@ def geoplot(
plt.title(title)

if img_tile is not None:
tiler = getattr(img_tiles, img_tile)(*img_tile_args)
tiler = getattr(img_tiles, img_tile)(**img_tile_args)
ax.add_image(tiler, tile)

colorbar_map = None
Expand Down
Binary file modified act/tests/baseline/test_geoplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified act/tests/baseline/test_geoplot_tile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions act/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ def test_geoplot():
try:
geodisplay.geoplot(
'tdry',
marker='.',
cartopy_feature=[
'STATES',
'LAND',
Expand Down Expand Up @@ -449,7 +448,6 @@ def test_geoplot_tile():
try:
geodisplay.geoplot(
'tdry',
marker='.',
cartopy_feature=[
'STATES',
'LAND',
Expand All @@ -461,7 +459,7 @@ def test_geoplot_tile():
],
text={'Ponca City': [-97.0725, 36.7125]},
img_tile='GoogleTiles',
img_tile_args=['RGB', 'terrain'],
img_tile_args={'style': 'street'},
)
try:
return geodisplay.fig
Expand Down

0 comments on commit ae793e7

Please sign in to comment.