Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas 2.2.0 test fixes #8638

Merged
merged 17 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7273,8 +7273,14 @@ Breaking changes
.. ipython:: python
:okwarning:
nameloCmaS marked this conversation as resolved.
Show resolved Hide resolved

ds = xray.Dataset({"t": pd.date_range("2000-01-01", periods=12, freq="M")})
ds["t.season"]
In[92]: ds = xray.Dataset({"t": pd.date_range("2000-01-01", periods=12, freq="M")})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this switch to ME? (We'll see in the docs build, so can wait if you're not sure)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "code-block" part and then the ":: ipython" above the code means it is static but with syntax highlighting. Doc.

I did this as I didn't want to "change history" and my quick fix of :okwarning: was not ok. The code was correct at v0.4 so shouldn't be refactored to run on modern code.


In[93]: ds["t.season"]
Out[93]:
<xarray.DataArray 'season' (t: 12)>
array(['DJF', 'DJF', 'MAM', ..., 'SON', 'SON', 'DJF'], dtype='<U3')
Coordinates:
* t (t) datetime64[ns] 2000-01-31 2000-02-29 ... 2000-11-30 2000-12-31

Previously, it returned numbered seasons 1 through 4.
- We have updated our use of the terms of "coordinates" and "variables". What
Expand Down
2 changes: 1 addition & 1 deletion xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ def save_mfdataset(

>>> ds = xr.Dataset(
... {"a": ("time", np.linspace(0, 1, 48))},
... coords={"time": pd.date_range("2010-01-01", freq="M", periods=48)},
... coords={"time": pd.date_range("2010-01-01", freq="ME", periods=48)},
... )
>>> ds
<xarray.Dataset>
Expand Down
Loading
Loading