Skip to content

Commit 5a4036b

Browse files
committed
Merge branch 'main' into concat_default_kwargs
2 parents 4d4deda + 0184702 commit 5a4036b

26 files changed

+486
-207
lines changed

doc/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,9 @@ a user passes ``old_arg``, we would instead catch it:
580580
581581
def func(new_arg, old_arg=None):
582582
if old_arg is not None:
583-
from warnings import warn
583+
from xarray.core.utils import emit_user_level_warning
584584
585-
warn(
585+
emit_user_level_warning(
586586
"`old_arg` has been deprecated, and in the future will raise an error."
587587
"Please use `new_arg` from now on.",
588588
DeprecationWarning,

doc/user-guide/weather-climate.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,18 @@ coordinate with dates from a no-leap calendar and a
9898
]
9999
da = xr.DataArray(np.arange(24), coords=[dates], dims=["time"], name="foo")
100100
101-
Xarray also includes a :py:func:`~xarray.cftime_range` function, which enables
101+
Xarray also includes a :py:func:`~xarray.date_range` function, which enables
102102
creating a :py:class:`~xarray.CFTimeIndex` with regularly-spaced dates. For
103-
instance, we can create the same dates and DataArray we created above using:
103+
instance, we can create the same dates and DataArray we created above using
104+
(note that ``use_cftime=True`` is not mandatory to return a
105+
:py:class:`~xarray.CFTimeIndex` for non-standard calendars, but can be nice
106+
to use to be explicit):
104107

105108
.. ipython:: python
106109
107-
dates = xr.cftime_range(start="0001", periods=24, freq="MS", calendar="noleap")
110+
dates = xr.date_range(
111+
start="0001", periods=24, freq="MS", calendar="noleap", use_cftime=True
112+
)
108113
da = xr.DataArray(np.arange(24), coords=[dates], dims=["time"], name="foo")
109114
110115
Mirroring pandas' method with the same name, :py:meth:`~xarray.infer_freq` allows one to
@@ -138,7 +143,9 @@ use ``pandas`` when possible, i.e. when the calendar is ``standard``/``gregorian
138143

139144
.. ipython:: python
140145
141-
dates = xr.cftime_range(start="2001", periods=24, freq="MS", calendar="noleap")
146+
dates = xr.date_range(
147+
start="2001", periods=24, freq="MS", calendar="noleap", use_cftime=True
148+
)
142149
da_nl = xr.DataArray(np.arange(24), coords=[dates], dims=["time"], name="foo")
143150
da_std = da.convert_calendar("standard", use_cftime=True)
144151

doc/whats-new.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ New Features
3030
By `Justus Magin <https://github.com/keewis>`_.
3131
- Added experimental support for coordinate transforms (not ready for public use yet!) (:pull:`9543`)
3232
By `Benoit Bovy <https://github.com/benbovy>`_.
33+
- Support reading to `GPU memory with Zarr <https://zarr.readthedocs.io/en/stable/user-guide/gpu.html>`_ (:pull:`10078`).
34+
By `Deepak Cherian <https://github.com/dcherian>`_.
3335

3436
Breaking changes
3537
~~~~~~~~~~~~~~~~
@@ -38,6 +40,9 @@ Breaking changes
3840

3941
Deprecations
4042
~~~~~~~~~~~~
43+
- Deprecate :py:func:`~xarray.cftime_range` in favor of :py:func:`~xarray.date_range` with ``use_cftime=True``
44+
(:issue:`9886`, :pull:`10024`).
45+
By `Josh Kihm <https://github.com/maddogghoek>`_.
4146
- Move from phony_dims=None to phony_dims="access" for h5netcdf-backend(:issue:`10049`, :pull:`10058`)
4247
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
4348

0 commit comments

Comments
 (0)