Skip to content

Commit

Permalink
Add check for annual aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienIrving authored Sep 20, 2024
1 parent b89df55 commit 3407ca1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unseen/time_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def temporal_aggregation(
agg_method,
variables,
season=None,
reset_times=False,
_times=False,
min_tsteps=None,
agg_dates=False,
time_dim="time",
Expand Down Expand Up @@ -149,6 +149,7 @@ def temporal_aggregation(
)

if reset_times:
assert target_freq[0:2] == "YE", "--reset_times is for annual aggregation"
diff = ds[time_dim].values[0] - start_time
ds[time_dim] = ds[time_dim] - diff
ds[time_dim] = ds[time_dim] + timedelta(days=1)
Expand Down

0 comments on commit 3407ca1

Please sign in to comment.