Skip to content

Commit

Permalink
Remove .values in _slice_from_grid (#890)
Browse files Browse the repository at this point in the history
Collecting values after isel in _slice_from_grid needs to be avoided to
keep the data in xarray/dask.

Fix #889

Co-authored-by: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com>
  • Loading branch information
kjnam and philipc2 authored Aug 16, 2024
1 parent 5410c4f commit 42488f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uxarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,17 +1077,17 @@ def _slice_from_grid(self, sliced_grid):
if self._face_centered():
d_var = self.isel(
n_face=sliced_grid._ds["subgrid_face_indices"], ignore_grid=True
).values
)

elif self._edge_centered():
d_var = self.isel(
n_edge=sliced_grid._ds["subgrid_edge_indices"], ignore_grid=True
).values
)

elif self._node_centered():
d_var = self.isel(
n_node=sliced_grid._ds["subgrid_node_indices"], ignore_grid=True
).values
)

else:
raise ValueError(
Expand Down

0 comments on commit 42488f2

Please sign in to comment.