Skip to content

Commit

Permalink
dt.weekday_name - removal of function (#8664)
Browse files Browse the repository at this point in the history
* Removed dt.weekday_name property

* string formatting

* remove from doc source

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* whats-new

* Revert "whats-new"

This reverts commit 41c7940.

* whats-new

* suggested changes: accessor_dt.py

Co-authored-by: Maximilian Roos <[email protected]>

* suggested changes: accessor_dt.py

Co-authored-by: Maximilian Roos <[email protected]>

* suggested changes: whats-new.rst

Co-authored-by: Maximilian Roos <[email protected]>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Roos <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2024
1 parent 6801e27 commit db9e448
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
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 wasn't functional on modern pandas versions and has been removed. (:issue:`8610`, :pull:`8664`)
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
8 changes: 2 additions & 6 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')`."
)
else:
field_values = getattr(values_as_cftimeindex, name)
Expand Down Expand Up @@ -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

0 comments on commit db9e448

Please sign in to comment.