Skip to content
forked from pydata/xarray

Commit

Permalink
fix cftime doctests (pydata#6192)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Jan 26, 2022
1 parent 4ef4112 commit 10bfa77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/coding/cftimeindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ def shift(self, n, freq):
>>> index = xr.cftime_range("2000", periods=1, freq="M")
>>> index
CFTimeIndex([2000-01-31 00:00:00],
dtype='object', length=1, calendar='gregorian', freq=None)
dtype='object', length=1, calendar='standard', freq=None)
>>> index.shift(1, "M")
CFTimeIndex([2000-02-29 00:00:00],
dtype='object', length=1, calendar='gregorian', freq=None)
dtype='object', length=1, calendar='standard', freq=None)
"""
from .cftime_offsets import to_offset

Expand Down Expand Up @@ -626,7 +626,7 @@ def to_datetimeindex(self, unsafe=False):
>>> times = xr.cftime_range("2000", periods=2, calendar="gregorian")
>>> times
CFTimeIndex([2000-01-01 00:00:00, 2000-01-02 00:00:00],
dtype='object', length=2, calendar='gregorian', freq=None)
dtype='object', length=2, calendar='standard', freq=None)
>>> times.to_datetimeindex()
DatetimeIndex(['2000-01-01', '2000-01-02'], dtype='datetime64[ns]', freq=None)
"""
Expand Down

0 comments on commit 10bfa77

Please sign in to comment.