diff --git a/doc/whats-new.rst b/doc/whats-new.rst index cf31faf88fc..63ac491e61e 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -45,8 +45,8 @@ Breaking changes Deprecations ~~~~~~~~~~~~ -- Following pandas, the `closed` arguments of :py:func:`cftime_range` and - :py:func:`date_range` are deprecated in favor of the `inclusive` arguments, +- Following pandas, the `closed` parameters of :py:func:`cftime_range` and + :py:func:`date_range` are deprecated in favor of the `inclusive` parameters, and will be removed in a future version of xarray (:issue:`6985`:, :pull:`7373`). By `Spencer Clark `_. diff --git a/xarray/coding/cftime_offsets.py b/xarray/coding/cftime_offsets.py index cf2ee558aaa..53f1066ff64 100644 --- a/xarray/coding/cftime_offsets.py +++ b/xarray/coding/cftime_offsets.py @@ -875,8 +875,8 @@ def __repr__(self) -> str: def _translate_closed_to_inclusive(closed): """Follows code added in pandas #43504.""" emit_user_level_warning( - "Following pandas, the `closed` argument is deprecated in " - "favor of the `inclusive` argument, and will be removed in " + "Following pandas, the `closed` parameter is deprecated in " + "favor of the `inclusive` parameter, and will be removed in " "a future version of xarray.", FutureWarning, ) @@ -933,14 +933,14 @@ def cftime_range( Normalize start/end dates to midnight before generating date range. name : str, default: None Name of the resulting index - closed : {"left", "right"} or None, default: _NoDefault + closed : {"left", "right"} or None, default: "no_default" Make the interval closed with respect to the given frequency to the "left", "right", or both sides (None). .. deprecated:: 2023.01.1 - Following pandas, the ``closed`` argument is deprecated in favor - of the ``inclusive`` argument, and will be removed in a future + Following pandas, the ``closed`` parameter is deprecated in favor + of the ``inclusive`` parameter, and will be removed in a future version of xarray. inclusive : {None, "both", "neither", "left", "right"}, default None @@ -1180,13 +1180,13 @@ def date_range( Normalize start/end dates to midnight before generating date range. name : str, default: None Name of the resulting index - closed : {"left", "right"} or None, default: _NoDefault + closed : {"left", "right"} or None, default: "no_default" Make the interval closed with respect to the given frequency to the "left", "right", or both sides (None). .. deprecated:: 2023.01.1 - Following pandas, the `closed` argument is deprecated in favor - of the `inclusive` argument, and will be removed in a future + Following pandas, the `closed` parameter is deprecated in favor + of the `inclusive` parameter, and will be removed in a future version of xarray. inclusive : {None, "both", "neither", "left", "right"}, default None Include boundaries; whether to set each bound as closed or open.