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

infer_freq: return 'YE' (#8629 follow-up) #8642

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Breaking changes

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

Deprecations
Expand Down
2 changes: 1 addition & 1 deletion xarray/coding/frequencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _get_annual_rule(self):
if len(np.unique(self.index.month)) > 1:
return None

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

def _get_quartely_rule(self):
if len(self.month_deltas) > 1:
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_cftimeindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ def test_infer_freq_invalid_inputs():
"freq",
[
"300YS-JAN",
"Y-DEC",
"YE-DEC",
"YS-JUL",
"2YS-FEB",
"QE-NOV",
Expand Down
Loading