From 6f8a2607d9f65490e2a8684fea87b6e945192cac Mon Sep 17 00:00:00 2001 From: syedhamidali Date: Thu, 19 Oct 2023 22:23:18 -0400 Subject: [PATCH] adding back xarray availablity check --- pyart/core/grid.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyart/core/grid.py b/pyart/core/grid.py index 081595afcb..8ac24dec81 100644 --- a/pyart/core/grid.py +++ b/pyart/core/grid.py @@ -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"]