Skip to content

Commit

Permalink
Recommend installing cftime when time decoding fails. (pydata#4134)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian authored Jun 12, 2020
1 parent 48fbee0 commit e8bd866
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xarray/coding/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ def _decode_cf_datetime_dtype(data, units, calendar, use_cftime):
"the default calendar" if calendar is None else "calendar %r" % calendar
)
msg = (
"unable to decode time units %r with %s. Try "
"opening your dataset with decode_times=False." % (units, calendar_msg)
f"unable to decode time units {units!r} with {calendar_msg!r}. Try "
"opening your dataset with decode_times=False or installing cftime "
"if it is not installed."
)
raise ValueError(msg)
else:
Expand Down

0 comments on commit e8bd866

Please sign in to comment.