Skip to content

Commit e576d39

Browse files
committed
Add time coordinate validation in Field init
1 parent e2d4912 commit e576d39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

parcels/field.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ def __init__(
189189
else:
190190
raise ValueError("Unsupported mesh type in data array attributes. Choose either: 'spherical' or 'flat'")
191191

192+
if self.data.shape[0] > 1:
193+
if "time" not in self.data.coords:
194+
raise ValueError("Field data is missing a 'time' coordinate.")
195+
192196
@property
193197
def units(self):
194198
return self._units

0 commit comments

Comments
 (0)