Skip to content

Commit

Permalink
Update time_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienIrving authored Sep 19, 2024
1 parent 84c8b26 commit b35d33f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unseen/time_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import cftime
import xarray as xr
from datetime import timedelta

from . import array_handling

Expand Down Expand Up @@ -150,7 +151,8 @@ def temporal_aggregation(
if reset_times:
diff = ds[time_dim].values[0] - start_time
ds[time_dim] = ds[time_dim] - diff
assert ds[time_dim].values[0] == start_time
ds[time_dim] = ds[time_dim] + timedelta(days=1)
assert ds[time_dim].values[0].month == start_time.month

if min_tsteps:
# Drop first and last time points with insufficient time steps
Expand Down

0 comments on commit b35d33f

Please sign in to comment.