You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: parcels/field.py
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,13 @@ def __init__(
166
166
self.name=name
167
167
self.data=data
168
168
self.grid=grid
169
-
self.time_interval=get_time_interval(data)
169
+
try:
170
+
self.time_interval=get_time_interval(data)
171
+
exceptValueErrorase:
172
+
e.add_note(
173
+
f"Error getting time interval for field {name!r}. Are you sure that the time dimension on the xarray dataset is stored as datetime or cftime datetime objects?"
174
+
)
175
+
raisee
170
176
171
177
# For compatibility with parts of the codebase that rely on v3 definition of Grid.
0 commit comments