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

dt.weekday_name - removal of function #8664

Merged
merged 12 commits into from
Jan 25, 2024
1 change: 0 additions & 1 deletion doc/api-hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
core.accessor_dt.DatetimeAccessor.time
core.accessor_dt.DatetimeAccessor.week
core.accessor_dt.DatetimeAccessor.weekday
core.accessor_dt.DatetimeAccessor.weekday_name
core.accessor_dt.DatetimeAccessor.weekofyear
core.accessor_dt.DatetimeAccessor.year

Expand Down
1 change: 0 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ Datetimelike properties
DataArray.dt.nanosecond
DataArray.dt.dayofweek
DataArray.dt.weekday
DataArray.dt.weekday_name
DataArray.dt.dayofyear
DataArray.dt.quarter
DataArray.dt.days_in_month
Expand Down
5 changes: 5 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Breaking changes

Deprecations
~~~~~~~~~~~~
- The `dt.weekday_name` parameter is now depreciated and has been removed. (:issue:`8610`, :pull:`8664`)
nameloCmaS marked this conversation as resolved.
Show resolved Hide resolved
By `Sam Coleman <https://github.com/nameloCmaS>`_.


Bug fixes
Expand Down Expand Up @@ -73,6 +75,9 @@ Documentation

- Pin ``sphinx-book-theme`` to ``1.0.1`` to fix a rendering issue with the sidebar in the docs. (:issue:`8619`, :pull:`8632`)
By `Tom Nicholas <https://github.com/TomNicholas>`_.
- Fixed documentation where the use of the depreciated pandas frequency string
prevented the documentation from being built. (:pull:`8638`)
By `Sam Coleman <https://github.com/nameloCmaS>`_.

.. _whats-new.2024.01.0:

Expand Down
10 changes: 3 additions & 7 deletions xarray/core/accessor_dt.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def _access_through_cftimeindex(values, name):
field_values = _season_from_months(months)
elif name == "date":
raise AttributeError(
"'CFTimeIndex' object has no attribute `date`. Consider using the floor method instead, for instance: `.time.dt.floor('D')`."
"'CFTimeIndex' object has no attribute `date`. Consider using the floor method "
+ "instead, for instance: `.time.dt.floor('D')`."
nameloCmaS marked this conversation as resolved.
Show resolved Hide resolved
)
else:
field_values = getattr(values_as_cftimeindex, name)
Expand Down Expand Up @@ -439,7 +440,7 @@ def weekofyear(self) -> DataArray:

warnings.warn(
"dt.weekofyear and dt.week have been deprecated. Please use "
"dt.isocalendar().week instead.",
+ "dt.isocalendar().week instead.",
nameloCmaS marked this conversation as resolved.
Show resolved Hide resolved
FutureWarning,
)

Expand All @@ -456,11 +457,6 @@ def dayofweek(self) -> T_DataArray:

weekday = dayofweek

@property
def weekday_name(self) -> T_DataArray:
"""The name of day in a week"""
return self._date_field("weekday_name", object)

@property
def dayofyear(self) -> T_DataArray:
"""The ordinal day of the year"""
Expand Down
Loading