Skip to content

Commit

Permalink
MNT: Added warning catch for axes. (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman authored Jun 29, 2022
1 parent 124da68 commit 529168e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pyart/graph/gridmapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def plot_grid(self, field, level=0, vmin=None, vmax=None,
+ " Overridding defined axes and using default "
+ "axes with projection Mercator.",
UserWarning)
ax = plt.axes(projection=projection)
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
ax = plt.axes(projection=projection)

# Define GeoAxes if None is provided.
else:
Expand All @@ -215,7 +217,9 @@ def plot_grid(self, field, level=0, vmin=None, vmax=None,
+ " Overridding defined axes and using default "
+ "axes with projection Mercator.",
UserWarning)
ax = plt.axes(projection=projection)
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
ax = plt.axes(projection=projection)

# plot the grid using xarray
if norm is not None: # if norm is set do not override with vmin/vmax
Expand Down
8 changes: 6 additions & 2 deletions pyart/graph/radarmapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ def plot_ppi_map(
+ " Overridding defined axes and using default "
+ "axes with projection Lambert Conformal.",
UserWarning)
ax = plt.axes(projection=projection)
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
ax = plt.axes(projection=projection)

# Define GeoAxes if None is provided.
else:
Expand All @@ -281,7 +283,9 @@ def plot_ppi_map(
+ " Overridding defined axes and using default "
+ "axes with projection Lambert Conformal.",
UserWarning)
ax = plt.axes(projection=projection)
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
ax = plt.axes(projection=projection)

if min_lon:
ax.set_extent([min_lon, max_lon, min_lat, max_lat],
Expand Down

0 comments on commit 529168e

Please sign in to comment.