Skip to content

Commit 29f049c

Browse files
Separate depth loading
As not all fields have depth coordinate
1 parent 817f204 commit 29f049c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/parcels/_core/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ def to_windowed_arrays(self, *, max_levels: int | None = None) -> Self:
103103
and ``max_levels`` then bounds its size.
104104
"""
105105
windowed = self.__dict__.setdefault("_windowed", {})
106-
for dim in ["lon", "lat", "depth"]:
106+
for dim in ["lon", "lat"]:
107107
# ensure lon and lat are loaded into memory for dask-backed datasets
108108
if is_dask_collection(self.data[dim]):
109109
self.data[dim].load()
110+
if "depth" in self.data.dims and is_dask_collection(self.data["depth"]):
111+
self.data["depth"].load()
110112
for name in self.scalar_field_names:
111113
current = windowed.get(name, self.data[name])
112114
windowed[name] = maybe_windowed(current, max_levels=max_levels)

0 commit comments

Comments
 (0)