From db9e448a8f836dc6b5ea970a9ba9029e920ad05c Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Thu, 25 Jan 2024 09:22:31 +0000 Subject: [PATCH] dt.weekday_name - removal of function (#8664) * 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 41c79409cbcb4494b7ffd317cd56028eec8df117. * whats-new * suggested changes: accessor_dt.py Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> * suggested changes: accessor_dt.py Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> * suggested changes: whats-new.rst Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --- doc/api-hidden.rst | 1 - doc/api.rst | 1 - doc/whats-new.rst | 5 +++++ xarray/core/accessor_dt.py | 8 ++------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst index 374fe41fde5..56ed487d5c6 100644 --- a/doc/api-hidden.rst +++ b/doc/api-hidden.rst @@ -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 diff --git a/doc/api.rst b/doc/api.rst index a7b526faa2a..a8f8ea7dd1c 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -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 diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 317f3b1a824..ac0015c14c5 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -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 `_. Bug fixes @@ -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 `_. +- Fixed documentation where the use of the depreciated pandas frequency string + prevented the documentation from being built. (:pull:`8638`) + By `Sam Coleman `_. .. _whats-new.2024.01.0: diff --git a/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index 2b964edbea7..65705a9d32f 100644 --- a/xarray/core/accessor_dt.py +++ b/xarray/core/accessor_dt.py @@ -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) @@ -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"""