Skip to content

Commit 2bbf0ff

Browse files
Apply suggestions from code review
Co-authored-by: Deepak Cherian <[email protected]>
1 parent 8ecda4e commit 2bbf0ff

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/user-guide/time-series.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ You can manual decode arrays in this form by passing a dataset to
8383
coder = xr.coders.CFDatetimeCoder(time_unit="s")
8484
xr.decode_cf(ds, decode_times=coder)
8585
86-
From xarray 2025.01.1 the resolution of the dates can be tuned between "s", "ms", "us" and "ns". One limitation of using ``datetime64[ns]`` is that it limits the native representation of dates to those that fall between the years 1678 and 2262, which gets increased significantly with lower resolutions. When a store contains dates outside of these bounds (or dates < 1582-10-15 with a Gregorian, also known as standard, calendar), dates will be returned as arrays of :py:class:`cftime.datetime` objects and a :py:class:`~xarray.CFTimeIndex` will be used for indexing.
86+
From xarray 2025.01.1 the resolution of the dates can be one of "s", "ms", "us" or "ns". One limitation of using ``datetime64[ns]`` is that it limits the native representation of dates to those that fall between the years 1678 and 2262, which gets increased significantly with lower resolutions. When a store contains dates outside of these bounds (or dates < 1582-10-15 with a Gregorian, also known as standard, calendar), dates will be returned as arrays of :py:class:`cftime.datetime` objects and a :py:class:`~xarray.CFTimeIndex` will be used for indexing.
8787
:py:class:`~xarray.CFTimeIndex` enables most of the indexing functionality of a :py:class:`pandas.DatetimeIndex`.
8888
See :ref:`CFTimeIndex` for more information.
8989

doc/user-guide/weather-climate.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ using a standard calendar, but outside the `precision range`_ and dates [prior t
7575

7676
- The dates are from a non-standard calendar
7777
- Any dates are outside the nanosecond-precision range (prior xarray version 2025.01.1)
78-
- Any dates are outside the time span limited by the resolution (from xarray version v2025.01.1)
78+
- Any dates are outside the time span limited by the resolution (from xarray version 2025.01.1)
7979

8080
Otherwise pandas-compatible dates from a standard calendar will be
8181
represented with the ``np.datetime64[unit]`` data type (where unit can be one of ["s", "ms", "us", "ns"]), enabling the use of a :py:class:`pandas.DatetimeIndex` or arrays with dtype ``np.datetime64[unit]`` and their full set of associated features.

xarray/tests/test_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def test_roundtrip_cftime_datetime_data(self) -> None:
616616
# proleptic gregorian will be decoded into numpy datetime64
617617
# fixing to expectations
618618
if actual.t.dtype.kind == "M":
619-
dtype = f"datetime64[{np.datetime_data(actual.t)[0]}]"
619+
dtype = actual.t.dtype
620620
expected_decoded_t = expected_decoded_t.astype(dtype)
621621
expected_decoded_t0 = expected_decoded_t0.astype(dtype)
622622
abs_diff = abs(actual.t.values - expected_decoded_t)

0 commit comments

Comments
 (0)