Skip to content

Commit

Permalink
adding back xarray availablity check
Browse files Browse the repository at this point in the history
  • Loading branch information
syedhamidali committed Oct 20, 2023
1 parent 8ad98a9 commit 6f8a260
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyart/core/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ def to_xarray(self):
in a one dimensional array.
"""

if not _XARRAY_AVAILABLE:
raise MissingOptionalDependency(
"Xarray is required to use Grid.to_xarray but is not " + "installed!"
)

lon, lat = self.get_point_longitude_latitude()
z = self.z["data"]
y = self.y["data"]
Expand Down

0 comments on commit 6f8a260

Please sign in to comment.