Skip to content

Commit bcc09ae

Browse files
committed
infer_freq: return 'YE' (pydata#8629 follow-up)
1 parent 5a92d48 commit bcc09ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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)