Skip to content

Commit

Permalink
MNT: make xarray optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman committed Apr 8, 2022
1 parent b547d10 commit f3ffc21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyart/core/tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
except ImportError:
_PYPROJ_AVAILABLE = False

try:
import xarray
_XARRAY_AVAILABLE = True
except ImportError:
_XARRAY_AVAILABLE = False

import pyart
from pyart.lazydict import LazyLoadDict
import netCDF4
Expand Down Expand Up @@ -74,6 +80,8 @@ def test_grid_write_method():
# assert grid1.nradar == grid2.nradar


@pytest.mark.skipif(not _XARRAY_AVAILABLE,
reason='Xarray is not installed')
def test_grid_to_xarray():
grid = pyart.testing.make_target_grid()
ds = grid.to_xarray()
Expand Down

0 comments on commit f3ffc21

Please sign in to comment.