Skip to content

Commit 4bb5175

Browse files
mathausemax-sixty
andauthored
infer_freq: return 'YE' (#8629 follow-up) (#8642)
* infer_freq: return 'YE' (#8629 follow-up) * fix whats new --------- Co-authored-by: Maximilian Roos <[email protected]>
1 parent 4b5c87b commit 4bb5175

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/whats-new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Breaking changes
2828

2929
- Following pandas, :py:meth:`infer_freq` will return ``"YE"``, instead of ``"Y"`` (formerly ``"A"``).
3030
This is to be consistent with the deprecation of the latter frequency string in pandas 2.2.
31-
This is a follow up to :pull:`8415` (:issue:`8612`, :pull:`8629`).
31+
This is a follow up to :pull:`8415` (:issue:`8612`, :pull:`8642`).
3232
By `Mathias Hauser <https://github.com/mathause>`_.
3333

3434
Deprecations

xarray/coding/frequencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _get_annual_rule(self):
183183
if len(np.unique(self.index.month)) > 1:
184184
return None
185185

186-
return {"cs": "YS", "ce": "Y"}.get(month_anchor_check(self.index))
186+
return {"cs": "YS", "ce": "YE"}.get(month_anchor_check(self.index))
187187

188188
def _get_quartely_rule(self):
189189
if len(self.month_deltas) > 1:

xarray/tests/test_cftimeindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ def test_infer_freq_invalid_inputs():
13531353
"freq",
13541354
[
13551355
"300YS-JAN",
1356-
"Y-DEC",
1356+
"YE-DEC",
13571357
"YS-JUL",
13581358
"2YS-FEB",
13591359
"QE-NOV",

0 commit comments

Comments
 (0)