Skip to content

Commit d6deb46

Browse files
nameloCmaSmax-sixtypre-commit-ci[bot]
authored
Pandas 2.2.0 test fixes (#8638)
* Fix doc building following breaking change in Pandas 2.2.0 https://pandas.pydata.org/docs/whatsnew/v2.2.0.html#deprecate-aliases-m-q-y-etc-in-favour-of-me-qe-ye-etc-for-offsets * Further fixes for changed Pandas 2.2 date aliases Fix docstrings following Pandas 2.2 date aliases changed * Update test_cftime_offsets.py * Update whats-new.rst Changed to code-block rather than suppressing the warning as PR comment. * Update dataarray.py Reverted due to different precision on aarch64 leading to different output. * Update test_accessor_dt.py Reverted * Update test_cftime_offsets.py Reverted changes. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update _aggregations.py Reversed changes * Update whats-new.rst Fixed hangover from clashing commits. * Update generate_aggregations.py * Update _aggregations.py Updated with xarray/util/generate_aggregations.py * Update whats-new.rst Corrected the correction... --------- Co-authored-by: Maximilian Roos <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5a92d48 commit d6deb46

File tree

6 files changed

+148
-143
lines changed

6 files changed

+148
-143
lines changed

doc/whats-new.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -7270,11 +7270,16 @@ Breaking changes
72707270
- The ``season`` datetime shortcut now returns an array of string labels
72717271
such `'DJF'`:
72727272

7273-
.. ipython:: python
7274-
:okwarning:
7273+
.. code-block:: ipython
72757274
7276-
ds = xray.Dataset({"t": pd.date_range("2000-01-01", periods=12, freq="M")})
7277-
ds["t.season"]
7275+
In[92]: ds = xray.Dataset({"t": pd.date_range("2000-01-01", periods=12, freq="M")})
7276+
7277+
In[93]: ds["t.season"]
7278+
Out[93]:
7279+
<xarray.DataArray 'season' (t: 12)>
7280+
array(['DJF', 'DJF', 'MAM', ..., 'SON', 'SON', 'DJF'], dtype='<U3')
7281+
Coordinates:
7282+
* t (t) datetime64[ns] 2000-01-31 2000-02-29 ... 2000-11-30 2000-12-31
72787283
72797284
Previously, it returned numbered seasons 1 through 4.
72807285
- We have updated our use of the terms of "coordinates" and "variables". What

xarray/backends/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ def save_mfdataset(
14331433
14341434
>>> ds = xr.Dataset(
14351435
... {"a": ("time", np.linspace(0, 1, 48))},
1436-
... coords={"time": pd.date_range("2010-01-01", freq="M", periods=48)},
1436+
... coords={"time": pd.date_range("2010-01-01", freq="ME", periods=48)},
14371437
... )
14381438
>>> ds
14391439
<xarray.Dataset>

0 commit comments

Comments
 (0)