Skip to content

Commit 4dcd776

Browse files
Move comment near the related code
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
1 parent 414745a commit 4dcd776

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

xarray/core/resample_cftime.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,16 @@ def __init__(
8484
self.freq = to_offset(freq)
8585
self.origin = origin
8686

87-
if (
88-
isinstance(self.freq, MonthEnd | QuarterEnd | YearEnd)
89-
or
87+
if isinstance(self.freq, MonthEnd | QuarterEnd | YearEnd) or self.origin in [
88+
"end",
89+
"end_day",
90+
]:
9091
# The backward resample sets ``closed`` to ``'right'`` by default
9192
# since the last value should be considered as the edge point for
9293
# the last bin. When origin in "end" or "end_day", the value for a
9394
# specific ``cftime.datetime`` index stands for the resample result
9495
# from the current ``cftime.datetime`` minus ``freq`` to the current
9596
# ``cftime.datetime`` with a right close.
96-
self.origin in ["end", "end_day"]
97-
):
9897
if closed is None:
9998
self.closed = "right"
10099
else:

0 commit comments

Comments
 (0)