Skip to content

Commit

Permalink
retract the change for timedelta conversion to make a separate PR
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1043 authored and tomvothecoder committed Nov 6, 2024
1 parent 826a7f1 commit f74699c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions xcdat/bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,7 @@ def _create_time_bounds( # noqa: C901
elif freq == "hour":
# Determine the daily frequency for generating time bounds.
if daily_subfreq is None:
diff = pd.to_timedelta(time.values[1] - time.values[0])
# `cftime` objects only support arithmetic using `timedelta` objects, so
# the values of `diff` must be casted from `dtype="timedelta64[ns]"`
# to `timedelta` objects.
diff = time.values[1] - time.values[0]
hrs = diff.seconds / 3600
daily_subfreq = int(24 / hrs) # type: ignore

Expand Down

0 comments on commit f74699c

Please sign in to comment.