From 5d2a76d4794861fe82fd85d9d74321caebd49882 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Wed, 24 Jan 2024 20:27:50 +0000 Subject: [PATCH 01/10] Removed dt.weekday_name property --- doc/api.rst | 1 - xarray/core/accessor_dt.py | 5 ----- 2 files changed, 6 deletions(-) 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/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index 2b964edbea7..67ac1297dff 100644 --- a/xarray/core/accessor_dt.py +++ b/xarray/core/accessor_dt.py @@ -456,11 +456,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""" From 5af94babf5830e731591877dec8f2bc2fe1d221a Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Wed, 24 Jan 2024 20:39:39 +0000 Subject: [PATCH 02/10] string formatting --- xarray/core/accessor_dt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index 67ac1297dff..c3d138b867b 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) @@ -438,7 +439,7 @@ def weekofyear(self) -> DataArray: "The week ordinal of the year" warnings.warn( - "dt.weekofyear and dt.week have been deprecated. Please use " + "dt.weekofyear and dt.week have been deprecated. Please use " + "dt.isocalendar().week instead.", FutureWarning, ) From b53a4ff71f3c7a2f7e9659559b76e39180991104 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Wed, 24 Jan 2024 21:24:56 +0000 Subject: [PATCH 03/10] remove from doc source --- doc/api-hidden.rst | 1 - 1 file changed, 1 deletion(-) 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 From f11d917dde1077250da9417ce78981c01a91936e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 23:01:08 +0000 Subject: [PATCH 04/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/core/accessor_dt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index c3d138b867b..a33421a5f5c 100644 --- a/xarray/core/accessor_dt.py +++ b/xarray/core/accessor_dt.py @@ -59,8 +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) @@ -439,8 +439,8 @@ def weekofyear(self) -> DataArray: "The week ordinal of the year" warnings.warn( - "dt.weekofyear and dt.week have been deprecated. Please use " + - "dt.isocalendar().week instead.", + "dt.weekofyear and dt.week have been deprecated. Please use " + + "dt.isocalendar().week instead.", FutureWarning, ) From 41c79409cbcb4494b7ffd317cd56028eec8df117 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Wed, 24 Jan 2024 23:04:38 +0000 Subject: [PATCH 05/10] whats-new --- doc/saved_on_disk.h5 | Bin 0 -> 8488 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/saved_on_disk.h5 diff --git a/doc/saved_on_disk.h5 b/doc/saved_on_disk.h5 new file mode 100644 index 0000000000000000000000000000000000000000..9a3a2f600dfc478e72087618d623b74a9bd0b7b0 GIT binary patch literal 8488 zcmeHMYit`u5T5fnt`lD#l#tMpASa?#)RxoMMDyXe$OngbNa_nHc zB?+j!RGvaWe()m_BBK952!0?yt&pIihzg1DP$VKi2~mK)NO%;f5{0m{yW_f6A`z+m zQ{Bqv*_oT2o&9!Z_ipdmwwBi7qLoE9rxU2m%TiY(Bp!LgNU9%qwzYKGw0CW_T&6nY zEozcai)^5vN?95H-zU}kkYUA9j{k~XMZ$_QFefVDsNlTaCV90dnS4m9-Bbm3CRP>5 z?~QoT+h1}-!c~BbYw}I*esQ^?@SbgoqM#`(L{$wvE@N#)^JXY0L5aEsdFjt%q6edZ zH-#O70D0zE)HBV8sw$Lॲj7)c|$LmifQ!z6U%@}FkwQ$A_=pe_BH6n@zw6(~q z;9yQNU4PIQ4#SP?2EvR!wzPKyLgDt#P$ca41p}Z}pMJNsp3sJ1|S!fYa>SCde!QN`dqE0_u?GPC3& zpNXO=uEYq|b9vOk$g;B@{#O_!i5U>!i5U>!i5U>!i5U>!i5U>!i5V(F2 zD6QJ^@P)h2>7N~#JA2EjFZ7!~nVB7a|AfABpk~NBHLbTss(IbQkF#Hn%p#Fhi!{`AD0KJNN@elq^6{@Vxok+EGz^=<2a z{&MW)bNXIav$?tYwBEAg&}3?MLcehTnLopq#&yr^`np%APU@`{@I&R+3H_~0&cjbX zGov3125Qa^f2Gs=J^OUS3x3AJLLXBEN1rOh2P%}&xdfd@ Date: Wed, 24 Jan 2024 23:06:04 +0000 Subject: [PATCH 06/10] Revert "whats-new" This reverts commit 41c79409cbcb4494b7ffd317cd56028eec8df117. --- doc/saved_on_disk.h5 | Bin 8488 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/saved_on_disk.h5 diff --git a/doc/saved_on_disk.h5 b/doc/saved_on_disk.h5 deleted file mode 100644 index 9a3a2f600dfc478e72087618d623b74a9bd0b7b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8488 zcmeHMYit`u5T5fnt`lD#l#tMpASa?#)RxoMMDyXe$OngbNa_nHc zB?+j!RGvaWe()m_BBK952!0?yt&pIihzg1DP$VKi2~mK)NO%;f5{0m{yW_f6A`z+m zQ{Bqv*_oT2o&9!Z_ipdmwwBi7qLoE9rxU2m%TiY(Bp!LgNU9%qwzYKGw0CW_T&6nY zEozcai)^5vN?95H-zU}kkYUA9j{k~XMZ$_QFefVDsNlTaCV90dnS4m9-Bbm3CRP>5 z?~QoT+h1}-!c~BbYw}I*esQ^?@SbgoqM#`(L{$wvE@N#)^JXY0L5aEsdFjt%q6edZ zH-#O70D0zE)HBV8sw$Lॲj7)c|$LmifQ!z6U%@}FkwQ$A_=pe_BH6n@zw6(~q z;9yQNU4PIQ4#SP?2EvR!wzPKyLgDt#P$ca41p}Z}pMJNsp3sJ1|S!fYa>SCde!QN`dqE0_u?GPC3& zpNXO=uEYq|b9vOk$g;B@{#O_!i5U>!i5U>!i5U>!i5U>!i5U>!i5V(F2 zD6QJ^@P)h2>7N~#JA2EjFZ7!~nVB7a|AfABpk~NBHLbTss(IbQkF#Hn%p#Fhi!{`AD0KJNN@elq^6{@Vxok+EGz^=<2a z{&MW)bNXIav$?tYwBEAg&}3?MLcehTnLopq#&yr^`np%APU@`{@I&R+3H_~0&cjbX zGov3125Qa^f2Gs=J^OUS3x3AJLLXBEN1rOh2P%}&xdfd@ Date: Wed, 24 Jan 2024 23:06:26 +0000 Subject: [PATCH 07/10] whats-new --- doc/whats-new.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 317f3b1a824..bd4e62f38f3 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -30,6 +30,8 @@ Breaking changes Deprecations ~~~~~~~~~~~~ +- The `dt.weekday_name` parameter is now depreciated 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: From 4cb1b36640bb02e92abb6717fb17e800e68d96b2 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Thu, 25 Jan 2024 07:10:40 +0000 Subject: [PATCH 08/10] suggested changes: accessor_dt.py Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --- xarray/core/accessor_dt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index a33421a5f5c..48832c8796a 100644 --- a/xarray/core/accessor_dt.py +++ b/xarray/core/accessor_dt.py @@ -60,7 +60,7 @@ def _access_through_cftimeindex(values, name): elif name == "date": raise AttributeError( "'CFTimeIndex' object has no attribute `date`. Consider using the floor method " - + "instead, for instance: `.time.dt.floor('D')`." + "instead, for instance: `.time.dt.floor('D')`." ) else: field_values = getattr(values_as_cftimeindex, name) From 41a35b53049aa62f23f75c9bb4b464738a08a9f7 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Thu, 25 Jan 2024 07:15:06 +0000 Subject: [PATCH 09/10] suggested changes: accessor_dt.py Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --- xarray/core/accessor_dt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/accessor_dt.py b/xarray/core/accessor_dt.py index 48832c8796a..65705a9d32f 100644 --- a/xarray/core/accessor_dt.py +++ b/xarray/core/accessor_dt.py @@ -440,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.", FutureWarning, ) From 8b52f429dc1d6891bada2271930ff96bd2124425 Mon Sep 17 00:00:00 2001 From: nameloCmaS Date: Thu, 25 Jan 2024 07:15:22 +0000 Subject: [PATCH 10/10] suggested changes: whats-new.rst Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --- doc/whats-new.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index bd4e62f38f3..ac0015c14c5 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -30,7 +30,7 @@ Breaking changes Deprecations ~~~~~~~~~~~~ -- The `dt.weekday_name` parameter is now depreciated and has been removed. (:issue:`8610`, :pull:`8664`) +- The `dt.weekday_name` parameter wasn't functional on modern pandas versions and has been removed. (:issue:`8610`, :pull:`8664`) By `Sam Coleman `_.